Jquery Tools: Scrollable - onBeforeSeek & onSeek toggle child div

Posted by Rick on Stack Overflow See other posts from Stack Overflow or by Rick
Published on 2010-04-11T16:16:47Z Indexed on 2010/04/11 16:23 UTC
Read the original article Hit count: 454

I'm scrolling some panels which contain some youtube clips using Jquery Tools Scrollable. I'd like to hide them during the transition to avoid a jerky animation.

Markup:

<div id="panel_items">
    <div id="wrap">
        <div class="event">
            <div class="header">Event 1</div><!-- Header is always displayed -->
            <div class="youtube">youtube clips</div><!-- hide during transition, then show -->
        </div>
        <div class="event">
            <div class="header">Event 2</div>
            <div class="youtube" style="display: none">More youtube clips</div>
        </div>
    </div>
</div>

Current JS:

$("#panel_items").scrollable({
    onBeforeSeek: function() { console.log("hide .child .youtube"); }, 
    onSeek: function() { console.log("Show child .youtube"); }      
});

Bonus question: How can I automatically set the height of #panel_items to match the current panel height (.event)?

Thank you.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about flowplayer