diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/game.js | 23 | ||||
-rw-r--r-- | js/layout.js | 3 |
2 files changed, 25 insertions, 1 deletions
@@ -5,9 +5,30 @@ var current=0; /* do the higlighting */ function hl(num) { var i; - for(i=0;i<14;i++){ $("#trick"+i).hide(); } + for(i=0;i<14;i++){ $("#trick"+i).hide(); $("#tricks"+i).removeClass('active'); } $("#trick"+num).css('display', 'block'); + $("#tricks"+num).addClass('active'); current=num; + + if(document.getElementById("tricks0")) + min=0; + else + min=1; + + if(document.getElementById("tricks13")) + max=13; + else + min=12; + + if(current==min) + $("#prevtr").addClass('disabled'); + else + $("#prevtr").removeClass('disabled'); + if(current==max) + $("#nexttr").addClass('disabled'); + else + $("#nexttr").removeClass('disabled'); + } /* highlight the last trick, useful when a page is called the first time*/ diff --git a/js/layout.js b/js/layout.js new file mode 100644 index 0000000..b98db8e --- /dev/null +++ b/js/layout.js @@ -0,0 +1,3 @@ +$(".navbar .nav").addClass("pull-right"); +$("table").addClass("table table-striped"); +$("ul.tricks").wrap('<div class="pagination">');
\ No newline at end of file |