son Posted September 14, 2009 Report Share Posted September 14, 2009 I have this working basic slideshow and wondered how you pass height and width. The current code assumes it is the same for each image, but I just noticed that this is acutally not the case... <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Slideshow</title><script type="text/javascript"><!--var image1=new Image()image1.src="hotel.jpg"var image2=new Image()image2.src="beach.jpg"var image3=new Image()image3.src="slides/main/bo_peep_to_arlington_reservoir.jpg"var image4=new Image()image4.src="onHorse.gif"var image5=new Image()image5.src="fish.jpg"//--></script></head><body><img src="hotel.jpg" name="slide" width="600" height="400" /><script><!--//variable that will increment through the imagesvar step=1function slideit(){//if browser does not support the image object, exit.if (!document.images)returndocument.images.slide.src=eval("image"+step+".src")step++if (step == 5)step =1//call function "slideit()" every 2.5 secondssetTimeout("slideit()",2500)}slideit()//--></script></body> Any ideas, helps, hints appreciated...Son Link to comment Share on other sites More sharing options...
Ingolme Posted September 14, 2009 Report Share Posted September 14, 2009 Just remove the width and height attributes from the <img> object and it should adjust the image correctly each time it changes. Link to comment Share on other sites More sharing options...
son Posted September 22, 2009 Author Report Share Posted September 22, 2009 Just remove the width and height attributes from the <img> object and it should adjust the image correctly each time it changes.Many thanks,Son Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now