c3d2-web/content/static/datenspuren/2014/fahrplan/assets/public_schedule-9eb645f6808...

1 line
1.1 KiB
JavaScript

(function(){$(function(){var e,t,n,r,i,s;e=$("table.rooms-table th").size(),t=Math.floor(($(window).width()-95)/200);if(e>t)return $("#conference-rooms").css("overflow","hidden"),$("#conference-rooms").css("width",t*200),n=1,r=Math.ceil(e/t),i="<span id='pages'>( ",i+="<span id='current-page'>"+n+"</span>",i+=" / ",i+="<span id='page-count'>"+r+"</span>",i+=" )</span>",i+="<a class='page-button disabled' href='#' id='previous-page'>&lt;</a> ",i+="<a class='page-button' href='#' id='next-page'>&gt;</a> ",$("#pagination").append(i),$("#pagination").width($("#conference-rooms").width()+$("#time-line").width()),s=200*t,$("a#next-page").click(function(e){if(n<r)return $("table.rooms-table").animate({left:"-="+s+"px"},"slow"),n+=1,$("a#previous-page").removeClass("disabled"),n===r&&$("a#next-page").addClass("disabled"),$("span#current-page").html(n),e.preventDefault()}),$("a#previous-page").click(function(e){if(n>1)return $("table.rooms-table").animate({left:"+="+s+"px"},"slow"),n-=1,$("a#next-page").removeClass("disabled"),n===1&&$("a#previous-page").addClass("disabled"),$("span#current-page").html(n),e.preventDefault()})})}).call(this);