YUI link slideshows between multiple pages

this code is created by me to link galleries between pages on this squarespace site: http://irenehoffman.com/

using YUI library

 

  Y.use('node', function() {
      Y.on('domready', function() {
if (Y.one('.next-slide')) {
          if (!Modernizr.touch) {
              Y.one('body').on('mousemove', function(event) {
                  if (event.clientX <= Y.one('body').get('winWidth') / 2 && Y.one('.nav.subnav ul li.gallery-collection.active-link').previous()) {
                      Y.one('.arrow-wrapper.left').addClass('seko').siblings().removeClass('seko');
                  } else if (event.clientX > Y.one('body').get('winWidth') / 2 && Y.one('.nav.subnav ul li.gallery-collection.active-link').next()) {
                      Y.one('.arrow-wrapper.right').addClass('seko').siblings().removeClass('seko');
                  }
              });

              Y.one('body').on('mouseleave', function() {
                  Y.all('.arrow-wrapper').removeClass('seko');
              });

          }

          Y.one('.next-slide').on('click', function(event) {
              if (!Y.one('#fullscreenBrowser .slideshow > .sqs-active-slide').next() && Y.one('.nav.subnav ul li.gallery-collection.active-link').next()) {
                  window.location = Y.one('.nav.subnav ul li.gallery-collection.active-link').next().one('a').get('href');
              }
          });

          Y.one('.prev-slide').on('click', function(event) {
              if (!Y.one('#fullscreenBrowser .slideshow > .sqs-active-slide').previous() && Y.one('.nav.subnav ul li.gallery-collection.active-link').previous()) {
                  window.location = Y.one('.nav.subnav ul li.gallery-collection.active-link').previous().one('a').get('href');
              }
          });

      }


      });
  });

 

Leave a Reply

Your email address will not be published. Required fields are marked *