Neb9
Neb9

Reputation: 91

Yepnope - loads files for desktop but doesn't load files for mobile

I've done something wrong but can't figure out what the first part of the script for desktop works and loads the scripts I want it to but when I test on mobile none of the mobile scripts get loaded! Can someone point out what I've done wrong.

Thanks

  <script src="/medias/custom-content/js/yepnope.1.5.4-min.js"></script>
  <script src="/medias/custom-content/js/categorizr.min.js"></script>

  <script>
  $(document).ready(function(){

  yepnope([{
    test: categorizr.isDesktop,
    yep: ['http://cdnjs.cloudflare.com/ajax/libs/jcarousel/0.3.0/jquery.jcarousel.min.js','/medias/custom-content/microsites/2014/event10/simple-sleek/desktop_carousel.js','/medias/custom-content/js/getjson.js'],
    complete: function() {
      for (i=1; i<=8; i++) {
              returnDetails("#item"+i);
      }
    }
  },
  {
    test: categorizr.isMobile,
    yep: ['/_ui/mobile/common/js/jquery.carouFredSel-6.2.1-packed.js','/medias/custom-content/microsites/2014/event10/simple-sleek/mobile_carousel.js','/medias/custom-content/js/getjson_mobile.js'],
    complete: function() {
      for (i=1; i<=8; i++) {
              returnDetails("#item"+i);
      }
    }
  }
  ]);

  });

  </script>

Here's the script that works:-

  <script src="/medias/custom-content/js/yepnope.1.5.4-min.js"></script>
  <script src="/medias/custom-content/js/categorizr.min.js"></script>

  <script>
  $(document).ready(function(){

  yepnope([{
    test: categorizr.isDesktop,
    yep: ['http://cdnjs.cloudflare.com/ajax/libs/jcarousel/0.3.0/jquery.jcarousel.min.js','/medias/custom-content/microsites/2014/event10/simple-sleek/desktop_carousel.js','/medias/custom-content/js/getjson.js'],
    nope: ['/_ui/mobile/common/js/jquery.carouFredSel-6.2.1-packed.js','/medias/custom-content/microsites/2014/event10/simple-sleek/mobile_carousel.js','/medias/custom-content/js/getjson_mobile.js'],
    complete: function() {
      for (i=1; i<=8; i++) {
              returnDetails("#item"+i);
      }
    }
  },
  ]);

  });

  </script>

Upvotes: 0

Views: 105

Answers (0)

Related Questions