Hello Everyone,
                      I 'm developing my web application using ASP.NET
2.0 with Ajax Extension 1.0. I have recently downloaded the jCarousel
component (jquery.jcarousel.js with jquery-1.2.3.pack.js) and made use
of it in my web application. The horizontal scrolling working fine in
IE7 and Firefox browser but it is not working correctly with Safari
browser. In Safari browser i inspected and found that the width of the
UL is smaller compared to that of what is shown for Firefox or IE7
(verified in Firebug and IE Dev Toolbar resp). This makes the carousel
to wrap the items and show in next row. I 'm using smaller image sizes
than what is provided in the demo files. I have also made necessary
changes to the skin files. Don't know why it is not working properly.

                     I fixed the width of this UL using this jQuery
script but the scrolling is not working correctly.

        function initCarousel(carID)
        {
            jQuery("#prm" + carID).jcarousel({
                scroll: 9,
                visible:10
            });

            //check if there are any items in the carousel. If no
items then we hide the carousel.
            //we get the count using the count of <li> under <ul>
excluding the <li> that has
            // css class name as jcarousel-item-placeholder-horizontal
            var liCount;
            liCount = $("#prm" + carID + " li:not(.jcarousel-item-
placeholder-horizontal)").get().length;

            if (liCount == 0)
            {
                //hide the carousel itself
                $("#prm" +
carID).parent().parent().parent().parent().remove();
            }
            else if(liCount <= 10)
            {
                //hide the navigation buttons
                $("#prm" + carID).parent().parent().find(".jcarousel-
prev,.jcarousel-next").remove();
            }

            //increase the length of the UL since its not of the
correct width in SAFARI browser only.
            if ($.browser.safari && liCount > 0)
            {
                var eachItemWidth, newWidth;
                eachItemWidth = 32;
                newWidth = eachItemWidth * liCount;
                $("#prm" + carID).css("width", newWidth + "px");
            }
        }


Actually, first i received this alert window (jCarousel: No width/
height set for items. This will cause an infinite loop. Aborting...)
in Safari browser. I then googled around and fixed this by just
commenting this alert window from the jquery.jcarousel.js script
file.

I 'm badly in need of your help. Expecting a solution to this.

Thanks and Regards,
Hemant.


Reply via email to