GrayMP

Untitled

Jul 26th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.onload = function () {
  2.     var prev = document.querySelector('input[data-direction="prev"]');
  3.     var next = document.querySelector('input[data-direction="next"]');
  4.  
  5.     rotator.initButtons(prev, next);
  6. // ....
  7. }
  8.  
  9. var rotator = rotator || new ImageRotator(".splash > img", "data-index", "visible", "hidden", ".details > img", ".details > div");
  10.  
  11. // constructor
  12. function ImageRotator()
  13. {
  14.     // ....
  15.  
  16.         this.initButtons = function (prev, next) {
  17.      
  18.         prev.onclick = function () {
  19.             that.rotateLeft();
  20.         };
  21.  
  22.         next.onclick = function () {
  23.             that.rotateRight();
  24.         };
  25.  
  26.         _prevButton = prev;
  27.         _nextButton = next;
  28.  
  29.         _refreshContent();
  30.     };
  31. }
Advertisement
Add Comment
Please, Sign In to add comment