mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-07-09 23:37:32 +00:00
Wait until jQuery is loaded before making clicky table
This commit is contained in:
parent
ec15770339
commit
4c2844e17e
@ -28,6 +28,14 @@ function navbar($links) {
|
||||
<!-- CSS -->
|
||||
<link href="includes/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="includes/css/custom.css" rel="stylesheet">
|
||||
<script type="text/javascript">
|
||||
function withjQuery(f) {
|
||||
if (window.jQuery) f();
|
||||
else window.setTimeout(function () {
|
||||
withjQuery(f);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<header class="navbar navbar-default navbar-static-top" role="banner">
|
||||
|
@ -361,7 +361,7 @@ class Page {
|
||||
public function table_end($clicky = true) {
|
||||
echo '</table>';
|
||||
if ($clicky) {
|
||||
echo "<script type=\"text/javascript\">$('tr').click(function(){window.location=$(this).find('a').attr('href');}).hover(function(){\$(this).toggleClass('hover');});</script>";
|
||||
echo "<script type=\"text/javascript\">withjQuery(function(){ $('tr').click(function(){window.location=$(this).find('a').attr('href');}).hover(function(){\$(this).toggleClass('hover');}); });</script>";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user