added pages and keyboard navigation

This commit is contained in:
Bachir Soussi Chiadmi
2016-11-20 11:43:52 +01:00
parent 5a3856e75b
commit 6850fa4d50
191 changed files with 34413 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
$(document).ready(function(){console.log("ready");var _current_pages=-1,_page_left_bg,_page_right_bg,_$page_left=$('#page-left'),_$page_right=$('#page-right'),_bgs_prefix="images/pages/";function init(){console.log("init",_$page_left);initkeyboard();changePages();};function nextPages(){if(_current_pages<_PAGES.length-2){_current_pages+=2;changePages();}};function prevPages(){if(_current_pages>-1){_current_pages-=2;changePages();}};function changePages(){console.log("changePages");_page_left_bg=_bgs_prefix+_PAGES[_current_pages];_page_right_bg=_bgs_prefix+_PAGES[_current_pages+1];console.log(_page_left_bg+" | "+_page_right_bg);_$page_left.css({'background-image':"url("+_page_left_bg+")"});_$page_right.css({'background-image':"url("+_page_right_bg+")"});};function initkeyboard(){keyboardJS.bind('right',function(event){nextPages();});keyboardJS.bind('left',function(event){prevPages();});};init();});