Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript AnythingSlider FX: flash of unstyled content

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #35055
    Nic
    Member

    I was determined to figure this out on my own (you know, a man’s never supposed to ask for driving directions!) but I’m stumped.

    I’m basically trying to re-create something like the main banner slider here. A few slides, auto-play, and stuff FXing in from the sides. My working draft is here.

    The problem is mainly with the first slide. Part of the problem is the fact that the outFX run at the start before the inFX. I know this is documented, but that Belgian site seems to have worked around this — I don’t see an ugly “out” animation on the first slide at pageload — it just loads in place (as though outFX *and* inFX have already completed).

    The other problem is that, when the slider cycles through and comes back around to the first slide again, the text from the slide momentarily appears unstyled, before disappearing into the inFX. What the heck?

    I’ve done everything I can think of, including going over that other site’s code with a fine eye. Help me Mottie, you’re my only hope!

    Thanks.

    #90228
    Mottie
    Member

    Hi Nic!

    LOL Oooo, I feel like Oni-wan… use the force Nic!

    I only glanced at the Belgian site quickly, they did some nice work with AnythingSlider!, but I didn’t see them use any of the FX options. If you look on the FX wiki page, you will see the “stopRepeat” option which is part of the FX extension. This option will prevent the FX from repeating on initialization and if the same slide gets clicked on again. If the code on that page looks confusing, then maybe this will simplify the whole thing:

    var sliderOptions = {},
    FxDefinitions = {},
    FxOptions = { stopRepeat : true };

    $('#slider')
    .anythingSlider(sliderOptions)
    .anythingSliderFX( FxDefinitions, FxOptions );

    I’m not seeing the unstyled text in the first slide, even on the second time around. Is it browser specific?

    #90230
    Nic
    Member

    Ooh, my hero!

    The ‘stopRepeat’ option totally fixed the problem of the outFX running on pageload. Wahoo! I owe you a beer.

    I spent an hour writing this response, and had at one point written several paragraphs of explanation/context for the flash of unstyled text problem. In the process, I decided to clean up my code before asking you to look at it again (just like I’d vacuum before having you over to my house).

    At some point, I realized that the problem was that I was using some ID (instead of class) selectors in that first slide. Well of course the cloned panel was causing havoc with the IDs, since there could only be one on a page at a time.

    After changing everything to classes, everything seems to work fine. (I’ve worked so hard on troubleshooting this that I owe me a beer.)

    Thanks again!

    #90242
    Mottie
    Member

    LOL great!

    And btw, all cloned slides get stripped of their IDs. So it shouldn’t have been finding or animating anything inside the clone slide – maybe that was part of the problem ;)

    And thanks for the offer, I’m not much of a beer drinker, I’ve just never got used to the taste. But I do love me some frou-frou drinks (umbrellas optional), umm and shots LOL, said in a manly voice.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.