troubleshooting Question

anythingSlider starts on the last slide in IE

Avatar of ukwebguy
ukwebguy asked on
CSSJavaScriptjQueryWeb Languages and StandardsWeb Development
11 Comments2 Solutions633 ViewsLast Modified:
I've added the CSS-Tricks anythingSlider to a page - it works correctly in Firefox and Chrome but in IE8, it starts on the last element instead of the first. This is a known bug apparently - Googling got me this...
---
When AnythingSlider is initialized on a hidden element, the last slide will show instead of the first. This is because a scrollLeft value cannot be applied to a hidden element. So either initialize it with visibility hidden, or if that isn't possible, then set the scrollLeft when it becomes visible:

    var s = $('#slider1').data('AnythingSlider');
    s.$window.scrollLeft( s.$window.width() + s.easingMargin ); // may not work if resizeContents is false (width will vary)

Can anyone explain how I implement this in my page, please? (not being a JavaScript/JQuery guru). I have a sample page here... http://www.cobwebbery.co.uk/anything/page.html which demonstrates the problem. I've obviously not done it correctly because I get an error '$window is null or not an object'

I've selected 250 points not because it looks like a huge problem but simply because I've got a client who needs this on Monday morning. BTW as you'll see from the site, the order of the slide is very important, so they must display in the correct order.

Many thanks



ASKER CERTIFIED SOLUTION
SSupreme

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros