jsor / jcarousel

Riding carousels with jQuery.
https://sorgalla.com/jcarousel/
MIT License
1.99k stars 734 forks source link

How To use Multiple versions of jcarousel #779

Closed R4NSS closed 8 years ago

R4NSS commented 8 years ago

Im using Hybris Spring MVC platform which uses jcarousel functionality out of the box. However, I need to put mulitple sliders on a page and this does not currently seem possible.

The First slider renders fine. However all the others are showing the loading icon and the sliders are not being rendered on the page. These other sliders need to also fade instead of rotate like the first one.

The html is as follows:

<div class="slider_component">
<div id="homepage_slider2" class="svw topSlider">
    <ul id="carousel${component.uid}">
        <c:forEach items="${banners}" var="banner" varStatus="status">
            <c:if test="${ycommerce:evaluateRestrictions(banner)}">
                <c:url value="${banner.urlLink}" var="encodedUrl" />
                <li>                                                                
                    <a tabindex="-1" href="${encodedUrl}"<c:if test="${banner.external}"> target="_blank"</c:if>>
                        <img src="${banner.media.url}" alt="${not empty banner.headline ? banner.headline : banner.media.altText}" title="${not empty banner.headline ? banner.headline : banner.media.altText}"/>                          
                        <c:if test="${banner.headline != null}">
                            <div class="LargehomepageBannerComponent">  
                                <h2>${banner.headline}</h2>     
                                <p>${banner.content}</p> 
                            </div>
                        </c:if>
                    </a>
                </li>
            </c:if>
        </c:forEach>
    </ul>
</div>

And the js file is sliderviewer 1.2 as below:

/*!

jQuery(function(){ jQuery("div.svw").prepend("<img src='" + ACC.config.commonResourcePath + "/images/spinner.gif' class='ldrgif' alt='loading...'/ >"); }); var j = 0; var quantofamo = 0; var currentActive = 0; var total = 0; var listelements = [];

jQuery.fn.slideView = function(settings) { settings = jQuery.extend({ easeFunc: "easeInOutExpo", easeTime: 750, uiBefore: false, toolTip: false, ttOpacity: 0.9, autoPlay: false, autoPlayTime: '8000' }, settings); return this.each(function(){ var container = jQuery(this); container.find("img.ldrgif").remove(); container.removeClass("svw").addClass("stripViewer");
var pictWidth = container.find("img").width(); var pictHeight = container.find("img").height(); var pictEls = container.find("li").size(); var stripViewerWidth = pictWidth*pictEls; container.find("ul").css("width" , stripViewerWidth); container.css("width" , pictWidth); container.css("height" , pictHeight); container.each(function(i) { (!settings.uiBefore) ? jQuery(this).after("

jsor commented 8 years ago

You're not using jCarousel here but another jQuery plugin called slideViewer. Please report any problem to the issue tracker of this project.