DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Miniature Slideshow For DIVs Using Scriptaculous
<div id="slideshow1" class="slide"><div>frame 1</div></div>
<div id="slideshow2" class="slide" style="display: none"><div>frame 2</div></div>
<div id="slideshow3" class="slide" style="display: none"><div>frame 3</div></div>
<div id="slideshow4" class="slide" style="display: none"><div>frame 4</div></div>
<script type="text/javascript">
start_slideshow(1, 4, 2000);
function start_slideshow(start_frame, end_frame, delay) {
setTimeout(switch_slides(start_frame,start_frame,end_frame, delay), delay);
}
function switch_slides(frame, start_frame, end_frame, delay) {
return (function() {
Effect.Fade('slideshow' + frame);
if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }
setTimeout("Effect.Appear('slideshow" + frame + "');", 850);
setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay + 850);
})
}
</script>




Comments
Snippets Manager replied on Wed, 2010/03/31 - 10:44am
Snippets Manager replied on Fri, 2010/01/29 - 12:56am
Snippets Manager replied on Fri, 2010/01/29 - 12:56am
North Point Community Church :: Home div#slidescontainer { height:225px; width:450px; position:relative; padding-bottom:20px; } div#slideshow { height:225px; z-index:10; text-align:center; width:450px; margin-left:auto; margin-right:auto; overflow: hidden; position: relative; } div#slideshow a { left: 0px; width: 450px !important; height: 225px !important; overflow: hidden; } img#next { position:absolute; bottom:30px; left:430px; z-index:50; cursor:pointer; } img#prev { position:absolute; bottom:30px; left:6px; z-index:50; cursor:pointer; } $(document).ready(function() { $("#tabs").tabs( { event: 'click'} ); $(".tab a").hoverIntent(function(){$(this).click();}, function() {}); /* Slideshow Initialization */ $("#slideshow").cycle({ fx: 'fade', speed: 300, timeout: 7000, next: '#next', prev: '#prev', pause: 1 }); $('#qlTextLink').click(function() { $('#callout').hide(); $('#quicklinks').slideToggle(); $('#qlButton').css('background-color','#3A6F8F'); $.cookie('quicklinks_close','true', {expires: 1, path: '/'}); pageTracker._trackEvent('Quick_Links', 'Click'); }); });
Got the top script, below from http://www.northpoint.org/styles/home http://www.blueacorn.com/Snippets Manager replied on Sun, 2009/04/26 - 6:05pm
Lucy0422 Lucy replied on Wed, 2009/03/18 - 1:46am
Snippets Manager replied on Mon, 2009/01/12 - 7:14pm
Snippets Manager replied on Wed, 2008/06/25 - 4:33pm
Hubbell HomesSnippets Manager replied on Mon, 2007/09/17 - 5:33am
Snippets Manager replied on Wed, 2007/07/25 - 5:51am
Snippets Manager replied on Fri, 2006/12/08 - 10:56pm
start_slideshow(1, 5, 2000);
function start_slideshow(start_frame, end_frame, delay) {
setTimeout(switch_slides(start_frame,start_frame,end_frame, delay), delay);
}
function switch_slides(frame, start_frame, end_frame, delay) {
return (function() {
Effect.Fade('slideshow' + frame);
if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }
setTimeout("Effect.Appear('slideshow" + frame + "');", 950);
setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay + 950);
})
}
Thanks again. :)Snippets Manager replied on Wed, 2006/08/09 - 8:18pm
Snippets Manager replied on Mon, 2012/05/07 - 2:17pm