I scroll through some panels that contain some YouTube clips using jQuery Tools scrollable . I would like to hide them during the transition in order to avoid harsh animations.
Markup:
<div id="panel_items">
<div id="wrap">
<div class="event">
<div class="header">Event 1</div>
<div class="youtube">youtube clips</div>
</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 #panel_itemsaccording to the current panel height ( .event)?
source
share