How To Make A Slideshow In Javascript
Im trying to make a slideshow with these images: Whenever I try this, it gets stuck on first image.
Solution 1:
Use cycle.js http://jquery.malsup.com/cycle/
$('#slideshow').cycle();
Solution 2:
<html><head><!-- You can load the jQuery library from the Google Content Network.
Probably better than from your own server. --><scripttype="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script><!-- Load the CloudCarousel JavaScript file --><scripttype="text/JavaScript"src="cloud-carousel.1.0.5.js"></script><script>
$(document).ready(function(){
// This initialises carousels on the container elements specified, in this case, carousel1.
$("#carousel1").CloudCarousel(
{
xPos: 128,
yPos: 32,
buttonLeft: $("#left-but"),
buttonRight: $("#right-but"),
altBox: $("#alt-text"),
titleBox: $("#title-text")
}
);
});
</script></head><body><!-- This is the container for the carousel. --><divid = "carousel1"style="width:1000px; height:700px;background:#000;overflow:scroll;"><!-- All images with class of "cloudcarousel" will be turned into carousel items --><!-- You can place links around these images --><imgclass = "cloudcarousel"src="images/Chrysanthemum.jpg"alt="Flag 1 Description"title="Flag 1 Title" /><imgclass = "cloudcarousel"src="images/Desert.jpg"alt="Flag 2 Description"title="Flag 2 Title" /><imgclass = "cloudcarousel"src="images/Hydrangeas.jpg"alt="Flag 3 Description"title="Flag 3 Title" /><imgclass = "cloudcarousel"src="images/Koala.jpg"alt="Flag 4 Description"title="Flag 4 Title" /></div><!-- Define left and right buttons. --><inputid="left-but"type="button"value="Left" /><inputid="right-but"type="button"value="Right" /><!-- Define elements to accept the alt and title text from the images. --><pid="title-text"></p><pid="alt-text"></p></body></html>
Solution 3:
There are many fancy light weight image slideshow plugins available in Jquery. Check http://wowslider.com/rq/jquery-images-slider/http://www.dreamcss.com/2009/04/create-beautiful-jquery-sliders.html
Post a Comment for "How To Make A Slideshow In Javascript"