html - Center Javascript Slideshow? -


this question has answer here:

i beginner @ coding , answers have come across have gone straight on head. code have make slideshow work (which working) is:

<script type="text/javascript"> <!--> var image1=new image() image1.src="congo.jpg" var image2=new image() image2.src="snow.jpg" var image3=new image() image3.src="mekong.jpg" //--> </script> 

and in body section:

<img src="congo.jpg" name="slide" width="400" height="300"> <script type="text/javascript"> <!-- var step=1 function slideit(){ document.images.slide.src=eval("image"+step+".src") if(step<3) step++ else step=1 settimeout("slideit()",2500) } slideit() //--> </script> 

i have no clue how center or put in margin. tried placing within table manipulate location, didn't work (assuming it's not easy), , tried messing around tag center pulling @ strings! proper way add margin/center? thank you.

you need put <div> around slideshow , apply text-align:center div.

<div style="text-align:center;">     <img src="congo.jpg" name="slide" width="400" height="300"> </div> 

quick , dirty example: https://jsfiddle.net/pbsz9spu/


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -