Link to home
Start Free TrialLog in
Avatar of ukwebguy
ukwebguy

asked on

anythingSlider starts on the last slide in IE

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



Avatar of SSupreme
SSupreme
Flag of Belarus image

It works fine on my IE8, but you have some problems with IE7.
Avatar of ukwebguy
ukwebguy

ASKER

OK -my IE8 may be compatibility mode - there is still a problem with IE7 - yes?
Yes
 User generated image
To resolve issue with IE7
Please add the following changes:
 
.art-blockheader .r
{
  width: 20px; //smaller value HERE
  right: 0;
  clip: rect(auto, auto, auto, 980px);
  background-position: right; //shifts background to right side
}

Open in new window

I'm sorry for the delay in replying as I had to go out. I've made the changes and the block headers are now displaying correctly in IE7 - however - the slider is still starting on the last element rather than the first.
ASKER CERTIFIED SOLUTION
Avatar of SSupreme
SSupreme
Flag of Belarus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have updated the slider - the markup (class="cloned panel") is not present in my markup - it appears to be added by the JavaScript in anythingSlider.js

How do I make the last last slide LOOK LIKE the last slide to IE - it keeps displaying it as the first one.

If you read my question carefully, this appears to be a known issue - I think this might be a JS question ie how to incorporate the JS snippet I've quoted in my question OR how to ensure that the first element is visible.
Thank you for your very quick assistance.
SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry for the delayin answering, but I eventually had to go to bed for a couple of hours.

I hadn't tried it, but I have now and that doesn't work either. I think I need to look at other sliders - they can't all be beaten by IE...
I didn't really get a solution, but the discussion helped to clarify my thought process - always useful in the 'wee small hours'.