kswedberg / jquery-carousel-lite

A jQuery carousel plugin based on jCarouselLite by Ganeshji Marwaha
MIT License
177 stars 59 forks source link

The width of the slides is not honoured by jcarousellite. #17

Closed alokmandloi closed 12 years ago

alokmandloi commented 12 years ago

My slides contain html content . For each li there is a top div for which i have mentioned dimensions as 410*998 but jcarousel lite takes width of each slide to be 952. This causes overlapping of slides.

I checked the plugin code and it uses jquery outerWIdth() . I suspect it has some problem .

Interestingly this happens only for the first time when the page loads . When I reload the page things work fine.

Following is the content in my li---

alokmandloi commented 12 years ago
<div class="intro_slides_container" id="intro_slide_1">
    <div class="intro_images">
        <img src="static/images/slide1.png">
    </div>
    <div class="intro_text_3">
        <div class="intro_text_bg">
            <div class="intro_text_heading">Making Shopping Delightful and Rewarding</div>
            <div class="intro_text_content">Discover nearby places, latest offers and hottest new arrivals.
                <br>Follow your favorite stores and brands.
                <br>Unlock real rewards , share reviews and tips</div>
        </div>
    </div>
</div>
alokmandloi commented 12 years ago

a similar problem faced by some other guy http://stackoverflow.com/questions/6917642/jquery-jcarousel-lite-automatically-setting-wrong-div-width

kswedberg commented 12 years ago

Thanks for the report. I'm guessing that the problem is caused by the timing of the plugin setting those widths. In any case, I would suggest you use the previously undocumented autoCSS option. Let me know if you run into any problems with this.

kswedberg commented 12 years ago

I don't understand. are you saying that autoCSS: false doesn't work? Are you using the most recent version of the plugin? Can you point me to a URL that shows the problem? Thanks.

alokmandloi commented 12 years ago

sorry about my previous comment , it was by mistake . I tried the autoCSS : false thing . But it did not work .

Also i have a circular jcarousellite . In that case what should i have as the margin-left for ul .

I am using the 1.6.4 version . I tried using the latest version but it seemed to have problems.

the link is http://delightcircle.com/

alokmandloi commented 12 years ago

I also went through the code for autCSS and saw that you were using liSize for animation . Which i think causes problem . because liSize is what the plugin gets wrong in first place . So atuoCSS does not server the purpose

kswedberg commented 12 years ago

Sorry, but I'm having a hard time working with the page you linked to. If you can create a reduced test case without the tons of other scripts and css, I'll have a better chance of locating and fixing the problem.

You really ought to update to the latest version of the plugin, or at least let me know what's wrong with it (my tests are passing and it looks fine where I'm using it) because "it seemed to have problems" is too vague for me to do anything about it. In any case, it looks like you figured out a solution to your problem, as I'm seeing the correct width now.

Part of the problem earlier may have been that the lis didn't have a width assigned to them in the css, and they were relying on loaded images to expand them to their full widths. If the jCarouselLite() was called before the images loaded, it could have thrown everything off.

If the problem is indeed fixed, please let me know so I can close this issue.

kswedberg commented 12 years ago

I'll assume that since you haven't responded and it looks like you've worked this out, the issue can be closed. Feel free to re-open or open another if you still have problems. But please provide a reduced test case that I can work with to troubleshoot the issue. Thanks!