mirror of
https://github.com/ChaosChemnitz/interfug15
synced 2024-12-22 10:02:23 +01:00
1 line
No EOL
1.1 KiB
JavaScript
1 line
No EOL
1.1 KiB
JavaScript
(function(){$(function(){var e,a,t,n,s,i;return e=$("table.rooms-table th").size(),a=Math.floor(($(window).width()-95)/200),e>a?($("#conference-rooms").css("overflow","hidden"),$("#conference-rooms").css("width",200*a),t=1,n=Math.ceil(e/a),s="<span id='pages'>( ",s+="<span id='current-page'>"+t+"</span>",s+=" / ",s+="<span id='page-count'>"+n+"</span>",s+=" )</span>",s+="<a class='page-button disabled' href='#' id='previous-page'><</a> ",s+="<a class='page-button' href='#' id='next-page'>></a> ",$("#pagination").append(s),$("#pagination").width($("#conference-rooms").width()+$("#time-line").width()),i=200*a,$("a#next-page").click(function(e){return n>t?($("table.rooms-table").animate({left:"-="+i+"px"},"slow"),t+=1,$("a#previous-page").removeClass("disabled"),t===n&&$("a#next-page").addClass("disabled"),$("span#current-page").html(t),e.preventDefault()):void 0}),$("a#previous-page").click(function(e){return t>1?($("table.rooms-table").animate({left:"+="+i+"px"},"slow"),t-=1,$("a#next-page").removeClass("disabled"),1===t&&$("a#previous-page").addClass("disabled"),$("span#current-page").html(t),e.preventDefault()):void 0})):void 0})}).call(this); |