Skip to content

Instantly share code, notes, and snippets.

@albell
Created March 15, 2013 22:23
Show Gist options
  • Save albell/5173607 to your computer and use it in GitHub Desktop.
Save albell/5173607 to your computer and use it in GitHub Desktop.
<div id="myshow" class="cycle-slideshow" data-cycle-pager="#pager-container">
<img src="img1.jpg"/>
<img src="img2.jpg"/>
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==" data-img="img3.jpg"/>
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==" data-img="img4.jpg"/>
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==" data-img="img5.jpg"/>
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==" data-img="img6.jpg"/>
</div>
<div id="pager-container"></div>
$(document).ready(function(){
$('#myshow').on( 'cycle-before', function(e, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag ) {
nextImg = $('#bigshow img').eq(optionHash.nextSlide + 1);
if ( nextImg.attr("src") == "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="){
nextImg.attr("src", nextImg.attr("data-img"));
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment