I want to scroll using jcarouselIndex attribute assigned to each Jcarousel slider

  • . Actually i have a jacarousel slider on my site's home page and a view more button on each node which is scrolling in the slider. Requirement is when user clicks on view more button it should go to "example" page and there is an other jacarousel slider with same nodes with their extra details and it should slide to exaclty same node for which user wants to see details. i went to jcarousel site http://sorgalla.com/jcarousel/docs/reference/api.html#scroll and check the method and i created a code in theme's javascript file. Here is what i'm doing
      var path = window.location.pathname;
      var index = window.location.href;
      var res = index.split("#");
      if (path == '/example/') {
        $('.jcarousel').jcarousel('scroll', res[1]);
      };
      if (path == '/') {
        $("ul.jcarousel").children().each(function(){
          var index = $(this).attr("jcarouselindex");
          $(this).find('a#view').attr("href", "example/#"+index);
        });
      };
    

    The problem is that my code is working awesome in firefox but not working in chrome. Seems like the jcarousel function is not working in chrome.
    $('.jcarousel').jcarousel('scroll', res[1]);

  • Comments

    ahmed.raza’s picture

    Issue summary: View changes
    shahzad-anwar’s picture

    I had the same issue. Didn't figure out what was the problem. Can any one help me here?

    markpavlitski’s picture

    Category: Bug report » Support request
    Status: Active » Closed (works as designed)

    I believe chrome doesn't support the window.location.href property so you will need to adjust your custom jQuery code.