JavaScript - (javascript) Help With Slideshow Text!
how do i make those two lines go away in the backround?
EDIT: UP! http://insidehb.com/main/default.html EDIT: Now works with ie Similar TutorialsI used the tutorial here to create a slideshow but would like to add captions... could anyone help me with the code? Below is part of the script I used... (there are 27 images so I cut it short... head code:<script type="text/javascript"> <!-- var image1=new Image() image1.src="images/pic_1.jpg" var image2=new Image() image2.src="images/pic_2.jpg" var image3=new Image() image3.src="images/pic_3.jpg" body code: <img src="images/pic_1.jpg" name="slide" width=180 height=150> <script> <!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) return document.images.slide.src=eval("image"+step+".src") if (step<27) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> I would really appreciate any help as I am a newbie to this... My code works great except that the margin and padding CSS isn't doing anything. Which doesn't make sense to me because the font size, style, and alignment is affected by the CSS. Does anyone know why this is?? Code: <h2 class="sidebar-heading">Testimonial:</h2> <html> <head> <title>Testimonies</title> <style type="text/css"> #quote { margin: 0 20px; padding-top: 20px; font-size: 1.1em; font-style: italic; text-align: left; } </style> <script type="text/javascript" language="javascript"> var testimony = new Array() testimony[1]= "<i>Testimonial 1</i>"; testimony[2]= "<i>Testimonial 2</i>"; testimony[3]= "<i>Testimonial 3</i>"; function firstTestimony() { document.getElementById('div_display').innerHTML=testimony[1]; setTimeout("secondTestimony()",2000); } function secondTestimony() { document.getElementById('div_display').innerHTML=testimony[2]; setTimeout("thirdTestimony()",2000); } function thirdTestimony() { document.getElementById('div_display').innerHTML=testimony[3]; setTimeout("firstTestimony()",2000); } </script> </head> <body> <span id="quote"> <div id="div_display"><script type="text/javascript" language="javascript">firstTestimony();</script></div> </span> </body> </html> Thanks!! I am learning Javascript and HTML5... I am trying to create a slideshow using canvas with text display of what the current image is. I have done this without canvas but I want to use canvas this time. My idea involves using the file name as the text display. Here is my working slideshow.. Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Slide Show</title> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> <script type="text/javascript"> var imagePaths = [ "images/Summer.jpg", "images/Spring.jpg", "images/Fall.jpg", "images/Winter.jpg", "images/Puppies.jpg", "images/Duck.jpg" ]; var showCanvas = null; var showCanvasCtx = null; var img = document.createElement("img"); var currentImage = 0; window.onload = function () { showCanvas = document.getElementById('showCanvas'); showCanvasCtx = showCanvas.getContext('2d'); img.setAttribute('width','480'); img.setAttribute('height','360'); } function nextImage() { currentImage++; if (currentImage >= imagePaths.length) currentImage = 0; img.setAttribute('src',imagePaths[currentImage]); img.onload = function() { showCanvasCtx.drawImage(img,0,0,480,360); } } function prevImage() { currentImage--; if (currentImage < 0) currentImage = imagePaths.length-1; img.setAttribute('src',imagePaths[currentImage]); img.onload = function() { showCanvasCtx.drawImage(img,0,0,480,360); } } </script> <style type="text/css"> <!-- #showCanvas { background-image: url(images/Summer.jpg); } #center { height: 360px; width: 491px; float: right; } #slideArea { height: 381px; width: 600px; margin-right: auto; margin-left: auto; } #right { height: 361px; width: 52px; float: right; } #left { float: left; height: 360px; width: 52px; } #nxtBtn { width: 57px; height: 57px; position: relative; top: 120px; } #bkBtn { height: 57px; width: 57px; position: relative; top: 120px; } #displayText { width: 600px; height: 20px; float: left; text-align: center; } --> </style> </head> <body> <br /> <div id="slideArea"> <div id="right"> <a href="#" id="nxtBtn"onClick="nextImage()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Next','','images/arrow-right-B.png',1)"><img src="images/arrow-right-A.png" name="Next" width="51" height="75" border="0"></a> </div> <div id="left"> <a href="#" id="bkBtn" onClick="prevImage()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Left','','images/arrow-left-B.png',1)"><img src="images/arrow-left-A.png" name="Left" width="51" height="75" border="0"></a></div> <div id="center"> <center> <canvas id="showCanvas" width="480" height="360" > Your browser does not support the canvas tag. <br /> Please upgrade your browser </canvas> </center> </div> <div id="displayText">Display Text</div> </div> </body> </html> This is what I came up with so far but it doesn't work. Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Slide Show</title> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> <script type="text/javascript"> ////added this code to be able to pull the display text from "imageName" var imagePath = ["images/]; var imageName = [ "Summer", "Spring", "Fall", "Winter", "Puppies", "Duck" ]; var imagePaths = imagePath + imageName + ".jpg"; ///////////////////// var showCanvas = null; var showCanvasCtx = null; var img = document.createElement("img"); var currentImage = 0; window.onload = function () { showCanvas = document.getElementById('showCanvas'); showCanvasCtx = showCanvas.getContext('2d'); img.setAttribute('width','480'); img.setAttribute('height','360'); } function nextImage() { currentImage++; if (currentImage >= imagePaths.length) currentImage = 0; img.setAttribute('src',imagePaths[currentImage]); img.onload = function() { showCanvasCtx.drawImage(img,0,0,480,360); } } function prevImage() { currentImage--; if (currentImage < 0) currentImage = imagePaths.length-1; img.setAttribute('src',imagePaths[currentImage]); img.onload = function() { showCanvasCtx.drawImage(img,0,0,480,360); } } </script> <style type="text/css"> <!-- #showCanvas { background-image: url(images/Summer.jpg); } #center { height: 360px; width: 491px; float: right; } #slideArea { height: 381px; width: 600px; margin-right: auto; margin-left: auto; } #right { height: 361px; width: 52px; float: right; } #left { float: left; height: 360px; width: 52px; } #nxtBtn { width: 57px; height: 57px; position: relative; top: 120px; } #bkBtn { height: 57px; width: 57px; position: relative; top: 120px; } #displayText { width: 600px; height: 20px; float: left; text-align: center; } --> </style> </head> <body> <br /> <div id="slideArea"> <div id="right"> <a href="#" id="nxtBtn"onClick="nextImage()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Next','','images/arrow-right-B.png',1)"><img src="images/arrow-right-A.png" name="Next" width="51" height="75" border="0"></a> </div> <div id="left"> <a href="#" id="bkBtn" onClick="prevImage()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Left','','images/arrow-left-B.png',1)"><img src="images/arrow-left-A.png" name="Left" width="51" height="75" border="0"></a></div> <div id="center"> <center> <canvas id="showCanvas" width="480" height="360" > Your browser does not support the canvas tag. <br /> Please upgrade your browser </canvas> </center> </div> <div id="displayText">Display Text</div> </div> </body> </htm> Any help would be greatly appreciated. Hey guys; I work as a webmaster for my school and I am trying to develop a JavaScript slideshow for pictures. I am a beginner to JavaScript, so if my coding is off, please let me know. What I am trying to do is have multiple automatic slideshows for this website. I want each of the slideshow boxes to run through the images, however the coding is wrong, causing the first box to switch through the images for the second box and the second one not switching at all. Sorry if thats confusing, please ask if you need any other specifications. Here is my JavaScript coding: //Slideshow //September 18 NewImg = new Array ("Pictures/Sept18/290.jpg", "Pictures/Sept18/293.jpg", "Pictures/Sept18/304.jpg", "Pictures/Sept18/310b.jpg", "Pictures/Sept18/311.jpg", "Pictures/Sept18/317.jpg", "Pictures/Sept18/323.jpg", "Pictures/Sept18/327.jpg", "Pictures/Sept18/328.jpg", "Pictures/Sept18/331.jpg", "Pictures/Sept18/333.jpg", "Pictures/Sept18/337.jpg", "Pictures/Sept18/339.jpg", "Pictures/Sept18/340.jpg", "Pictures/Sept18/342.jpg", "Pictures/Sept18/344.jpg", "Pictures/Sept18/346.jpg", "Pictures/Sept18/351.jpg", "Pictures/Sept18/352.jpg", "Pictures/Sept18/353.jpg", "Pictures/Sept18/354.jpg", "Pictures/Sept18/356.jpg", "Pictures/Sept18/359.jpg", "Pictures/Sept18/360b.jpg", "Pictures/Sept18/361.jpg", "Pictures/Sept18/362.jpg", "Pictures/Sept18/363b.jpg", "Pictures/Sept18/366.jpg", "Pictures/Sept18/370.jpg", "Pictures/Sept18/374b.jpg", "Pictures/Sept18/379.jpg", "Pictures/Sept18/385.jpg", "Pictures/Sept18/391.jpg", "Pictures/Sept18/392.jpg", "Pictures/Sept18/393.jpg", "Pictures/Sept18/394.jpg", "Pictures/Sept18/398.jpg", "Pictures/Sept18/408.jpg", "Pictures/Sept18/410.jpg", "Pictures/Sept18/415.jpg", "Pictures/Sept18/419.jpg", "Pictures/Sept18/427.jpg", "Pictures/Sept18/428b.jpg", "Pictures/Sept18/429.jpg", "Pictures/Sept18/432.jpg", "Pictures/Sept18/435.jpg", "Pictures/Sept18/440.jpg", "Pictures/Sept18/441.jpg", "Pictures/Sept18/443.jpg", "Pictures/Sept18/448.jpg", "Pictures/Sept18/449.jpg", "Pictures/Sept18/450.jpg", "Pictures/Sept18/455.jpg", "Pictures/Sept18/456.jpg", "Pictures/Sept18/460.jpg", "Pictures/Sept18/461.jpg", "Pictures/Sept18/463.jpg", "Pictures/Sept18/467.jpg", "Pictures/Sept18/470.jpg", "Pictures/Sept18/474b.jpg", "Pictures/Sept18/478b.jpg", "Pictures/Sept18/481.jpg", "Pictures/Sept18/484.jpg", "Pictures/Sept18/486.jpg", "Pictures/Sept18/491b.jpg", "Pictures/Sept18/496.jpg", "Pictures/Sept18/498b.jpg", "Pictures/Sept18/503.jpg", "Pictures/Sept18/505b.jpg", "Pictures/Sept18/506b.jpg", "Pictures/Sept18/508.jpg", "Pictures/Sept18/509.jpg", "Pictures/Sept18/514.jpg", "Pictures/Sept18/525b.jpg", "Pictures/Sept18/527.jpg", "Pictures/Sept18/531b.jpg", "Pictures/Sept18/532b.jpg", "Pictures/Sept18/533b.jpg", "Pictures/Sept18/538b.jpg", "Pictures/Sept18/542.jpg", "Pictures/Sept18/544b.jpg", "Pictures/Sept18/547.jpg", "Pictures/Sept18/549.jpg", "Pictures/Sept18/557b.jpg", "Pictures/Sept18/560.jpg", "Pictures/Sept18/565.jpg", "Pictures/Sept18/567.jpg", "Pictures/Sept18/571b.jpg", "Pictures/Sept18/574b.jpg", "Pictures/Sept18/583b.jpg", "Pictures/Sept18/587.jpg", "Pictures/Sept18/588.jpg", "Pictures/Sept18/597b.jpg", "Pictures/Sept18/610b.jpg"); var ImgNum = 0; var ImgLength = NewImg.length - 1; var delay = 2500; var lock = false; var run; function chgImg(direction) { if (document.images) { ImgNum = ImgNum + direction; if (ImgNum > ImgLength) { ImgNum = 0; } if (ImgNum < 0) { ImgNum = ImgLength; } document.sept18.src = NewImg[ImgNum]; } } function auto() { if (lock == false) { lock = true; run = setInterval("chgImg(1)", delay); } } //September 25 NewImg = new Array ("Pictures/Sept25/626b.jpg", "Pictures/Sept25/633.jpg", "Pictures/Sept25/634.jpg", "Pictures/Sept25/636.jpg", "Pictures/Sept25/639.jpg"); var ImgNum = 0; var ImgLength = NewImg.length - 1; var delay = 2500; var lock = false; var run; function chgImg(direction) { if (document.images) { ImgNum = ImgNum + direction; if (ImgNum > ImgLength) { ImgNum = 0; } if (ImgNum < 0) { ImgNum = ImgLength; } document.sept18.src = NewImg[ImgNum]; } } function auto() { if (lock == false) { lock = true; run = setInterval("chgImg(1)", delay); } } And here is where in the HTML the coding is referred to: <?php include 'top.php' ?> <img src="Images/Bar_Images/home.png" class="header" /> <p>Welcome to the TCNJ Women's Club Rugby homepage!</p><br /> <p class="sub">Pictures</p> <div class="box"> <a href="http://www.tcnj.edu/~rugby/sept18.php"><img name="sept18" src="Pictures/Sept18/290.jpg" class="slides" align="left" /></a> <p align="right">September 18th, 2010</p> </div> <div class="box"> <a href="http://www.tcnj.edu/~rugby/sept25.php"><img name="Sept25" src="Pictures/Sept25/626b.jpg" class="slides" align="left" /></a> <p align="right">September 25th, 2010</p> </div> <?php include 'bottom.php' ?> As you can see, I am using PHP to refer to other pages, but the JavaScript coding is referred to in the <head> and the <body> tag is onloading the auto() function. Please help me fix this code, or if it is impossible to do it this way, let me know. Thank you. Hi, Pretty simple problem I hope Ive somehow changed something in my coding on my html page to stop the slide show working correctly. Any ideas heres the link: http://sparekeys.org.uk/ Please help i know its something stupid but I just cant see it. I have created two pages. One with a selection of images one with a working slideshow. How do I get it that a user can select 4 images that are then transferred to the slideshow and played in that slideshow? I appolgise if this is a simple fix but I am very new to JavaScript. Thank you all in advance Hi, I don't really know much about Javascript but I was wondering if anyone could tell me how to change this script so when you click on a link it doesn't open in a new window? Any help would be much appreciated! Code: <script language="JavaScript1.1"> <!-- var slideimages=new Array() var slidelinks=new Array() function slideshowimages(){ for (i=0;i<slideshowimages.arguments.length;i++){ slideimages[i]=new Image() slideimages[i].src=slideshowimages.arguments[i] } } function slideshowlinks(){ for (i=0;i<slideshowlinks.arguments.length;i++) slidelinks[i]=slideshowlinks.arguments[i] } function gotoshow(){ if (!window.winslide||winslide.closed) winslide=window.open(slidelinks[whichlink]) else winslide.location=slidelinks[whichlink] winslide.focus() } //--> </script><br> <a href="javascript:gotoshow()"><img src="/images/brochure/2010/homepage_freestyle/Feb/Banner-Paris-special-129.jpg" name="slide" border=0 width=429 height=90></a> <script> <!-- //configure the paths of the images, plus corresponding target links slideshowimages("/images/brochure/2010/homepage_freestyle/Feb/Banner-Paris-special-129.jpg","/images/brochure/2010/homepage_freestyle/Feb/Banner-3-for-1.jpg","/images/brochure/2010/homepage_freestyle/Feb/Banner-London-89.jpg","/images/brochure/2010/homepage_freestyle/Feb/Banner-Brussels-special-155.jpg") slideshowlinks("/dl/holidayoffers.jsp?destination=DISCOVER_PARIS_BREAKS,RE,TO","/dl/holidayoffers.jsp?destination=MAILER_EUROSTAR_3_FOR_1,RE,TO,","/dl/holidayoffers.jsp?destination=london_rail_breaks,RE,TO,","/dl/holidayoffers.jsp?destination=DISCOVER_BRUSSELS,RE,TO,") //configure the speed of the slideshow, in miliseconds var slideshowspeed=3000 var whichlink=0 var whichimage=0 function slideit(){ if (!document.images) return document.images.slide.src=slideimages[whichimage].src whichlink=whichimage if (whichimage<slideimages.length-1) whichimage++ else whichimage=0 setTimeout("slideit()",slideshowspeed) } slideit() //--> </script> <p> I am very new to Javascript - as in this is the first day I'm using it. I am using a code I got offline to fade three pictures together, but when it gets to the last image, it loops back to the first. How do I code it so that when it gets to the last image, it stops? Here is the code - sorry if its messy. Javascript: /***** Image Cross Fade Redux Version 1.0 Last revision: 02.15.2006 steve@slayeroffice.com Please leave this notice intact. Rewrite of old code found he http://slayeroffice.com/code/imageCrossFade/index.html *****/ window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so _init); var d=document, imgs = new Array(), zInterval = null, current=0, pause=false; function so_init() { if(!d.getElementById || !d.createElement)return; // DON'T FORGET TO GRAB THIS FILE AND PLACE IT ON YOUR SERVER IN THE SAME DIRECTORY AS THE JAVASCRIPT! // http://slayeroffice.com/code/imageCrossFade/xfade2.css css = d.createElement("link"); css.setAttribute("href","xfade2.css"); css.setAttribute("rel","stylesheet"); css.setAttribute("type","text/css"); d.getElementsByTagName("head")[0].appendChild(css); imgs = d.getElementById("imageContainer").getElementsByTagName("img"); for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0; imgs[0].style.display = "block"; imgs[0].xOpacity = .99; setTimeout(so_xfade,3000); } function so_xfade() { cOpacity = imgs[current].xOpacity; nIndex = imgs[current+1]?current+1:0; nOpacity = imgs[nIndex].xOpacity; cOpacity-=.05; nOpacity+=.05; imgs[nIndex].style.display = "block"; imgs[current].xOpacity = cOpacity; imgs[nIndex].xOpacity = nOpacity; setOpacity(imgs[current]); setOpacity(imgs[nIndex]); if(cOpacity<=0) { imgs[current].style.display = "none"; current = nIndex; setTimeout(so_xfade,3000); } else { setTimeout(so_xfade,50); } function setOpacity(obj) { if(obj.xOpacity>.99) { obj.xOpacity = .99; return; } obj.style.opacity = obj.xOpacity; obj.style.MozOpacity = obj.xOpacity; obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")"; } } HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <div class="container"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="imagetoolbar" content="false" /> <link rel="stylesheet" href="style.css" type="text/css" /> <script type="text/javascript" src="slideshow.js"></script> <title>Diamonds in the Rough</title> </head> <body> <div id="container"> <img src="images/top2.jpg" usemap="#Map2"/> <map name="Map2" id="Map2"> <area shape="rect" coords="69,56,145,84" href="invite.html" rel="nofollow" target="_self" alt="The Gala" /> <area shape="rect" coords="171,53,356,87" href="diamonds.html" rel="nofollow" target="_self" alt="Diamonds in the Rough" /> <area shape="rect" coords="377,52,498,87" href="mariama.html" rel="nofollow" target="_self" alt="Speaker Mariama Elliot" /> <area shape="rect" coords="525,52,636,86" href="contact.html" rel="nofollow" target="_self" alt="Get Involved" /> </map> <div id="imageContainer"> <img src="images/index.jpg"/> <img src="images/index2.jpg"/> <img src="images/invite.jpg"/> </div> <div id="container2"> <img src="images/BOTTOM.jpg"/> </div> </body> </html> Thanks for your help! http://www.javascriptkit.com/script/...2/3slide.shtml Hi i have the above image slideshow script running fine on a webpage can anybody tell me how i can get it to run a second time to show a second different slideshow on the same page? Ive tried editing variables but i cant work it out. would be much appreciated Ta I've created a slideshow on our site using the java template at http://www.javascriptkit.com/script/.../jsslide.shtml Are there simple modifications I can make to this code in order to cause clicking on the image links to go straight to them, rather than creating a new window/tab? Thanks for the help. New to the forum so any help you can provide is greatly appreciated. I have been using a Javascript slideshow code for several websites. I create images that are exactly the same size and then the slideshow moves through them with a cross-fade. Cross-fade does not work in FireFox but images still change over nicely, just no fade. In IE, the cross-fade worked beautifully, creating a seamless transition between images. Now - I'm guessing within the last 2 months? - these images in IE 'jump'. Instead of a seamless transition, the fade causes the next image in show to come in from upper left of slide show area. So images appear to jump into place rather than slowly transition in. Did IE change something in the way it processes Java? This code worked perfectly until recently. I'm not a Java programmer - using this code from another source. Here is heart of the transition code: [CODE] var tss; var iss; var jss = 1; var pss = Picture.length-1; var preLoad = new Array(); for (iss = 1; iss < pss+1; iss++){ preLoad[iss] = new Image(); preLoad[iss].src = Picture[iss];} function runSlideShow(){ if (document.all){ document.images.PictureBox.style.filter="blendTrans(duration=2)"; document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)"; document.images.PictureBox.filters.blendTrans.Apply();} document.images.PictureBox.src = preLoad[jss].src; if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss]; if (document.all) document.images.PictureBox.filters.blendTrans.Play(); jss = jss + 1; if (jss > (pss)) jss=1; tss = setTimeout('runSlideShow()', SlideShowSpeed); } [CODE] As I said, I have used this code on several websites & it is the focal point for a nice-looking display. Any input, help or advice is greatly appreciated. Thanks to Old Pedant , in this forum, I am using this basic code for a slideshow he posted: Code: var slides = [ [ "abc.jpg", 3000 ], [ "xyz.png", 5000 ], [ "foo.gif", 1500 ] ]; var curSlide = 0; function nextSlide( ) { document.getElementById("thePicture").src = slides[curSlide][0].src; setTimeout( nextSlide, slides[curSlide][1] ); curSlide = ( curSlide + 1 ) % slides.length; } function setUp( ) { for ( var s = 0; s < slides.length; ++s ) { var image = new Image(); image.src = slides[s]; slides[s] = image; } nextSlide( ); } window.onload = setUp; which works just fine. But I can't find a way for it to play one round of the slides then stop. Could someone please help me with the right bit of code to stop the show? I know the code is a bit basic (no fades etc) but I have been unable to find a similar slideshow product that gives variable time delays for each slide. I've googled endlessly but nothing could i find.... TIA Richard ========= Hi there, I am currently creating my first ever website and I am attempting to put in some javascript but I am having trouble, would it be possible for someone to guide me. I am trying to implement a slideshow but at the moment all I am getting is the first picture only, here is the code... Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Lyons Design and Print</title> <style type="text/css" media="all"> body { background-image:url('background.jpg'); } .header { font-size: 24pt; font-weight: bold; padding: 20px; border-bottom: 1px solid #000; text-align:center; } #nav { margin:0; padding:0; float:left; width:100%; border:1px solid #42432d border-width:1px 0; text-align: center; } #nav li { display:inline-block; padding:0; margin:0; } * html #nav li { display: inline; } *+html #nav li { display: inline; } #nav a:link, #nav a:visited { color:#000; background:#0033CC; padding:20px 40px 4px 10px; float:left; width:auto; border-right:1px solid #42432d; text-decoration:none; font:bold 1em/1em Arial, Helvetica, sans-serif; text-shadow: 2px 2px 2px #555; } #nav a:hover, #nav a:focus { color:#fff; background:#0033CC; } #nav li:first-child a { border-left:1px solid #42432d; } #home #nav-home a, #large format printing #nav-large format printing a, #scanning #nav-scanning a, #thermal inkjet printing and plotting #nav-thermal inkjet printing and plotting a, #large format photo copying #nav-large format photo copying a, #contacts #nav-contacts a, #about us #nav-about us a { background:#e35a00; color:#fff; text-shadow:none; } #home #nav-home a:hover, #large format printing #nav-large format printing a:hover, #scanning #nav-scanning a:hover, #thermal inkjet printing and plotting #nav-thermal inkjet printing and plotting a:hover, #large format photo copying #nav-large format photo copying a:hover, #contacts #nav-contacts a:hover, #about us #nav-about us a:hover { background:#e35a00; } #nav a:active { background:#e35a00; color:#fff; } p{ font-family: Verdana, Geneva, sans-serif; font-style: oblique; font-weight: normal; font-size: 16px; letter-spacing: normal; line-height: normal; text-transform: none; text-decoration: none; text-align: center; } p{ font-family: Verdana, Geneva, sans-serif; font-style: oblique; font-weight: normal; font-size: 16px; letter-spacing: normal; line-height: normal; text-transform: none; text-decoration: none; text-align: center; } <script type="text/javascript"> <!-- var image1=new Image() image1.src="DesignPrinter.jpg" var image2=new Image() image2.src="print-design.jpg" var image3=new Image() image3.src="printingpress.jpg" var image4=new Image() image4.src="thermal.jpg" //--> </script> <script> <!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) return document.images.slide.src=eval("image"+step+".src") if (step<3) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> </style> </head> <body> <div class="header"><img src="logo.jpg"></div> <ul id="nav"> <li id="nav-Home"><a href="Home.html">Home</a></li> <li id="nav-Large Format Printing"><a href="Large Format Printing.html">Large Format Printing</a></li> <li id="nav-Scanning"><a href="Scanning.html">Scanning</a></li> <li id="nav-Thermal Inkjet Printing and Plotting"><a href="Thermal Inkjet Printing and Plotting.html">Thermal Inkjet Printing and Plotting</a></li> <li id="nav-Large Format Photo Copying"><a href="Large Format Photo Copying.html">Large Format Photo Copying</a></li> <li id="nav-Contacts"><a href="#">Contacts</a></li> <li id="nav-About Us"><a href="#">About Us</a></li></ul> <table border="0" cellpadding="0" cellspacing="0" height="300"><tr><td id="maincontent" valign="top"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. </p> <p align="center"><img src="DesignPrinter.jpg" name="slide" width=300 height=300></p> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate </p> <embed src="beatles.mid" width="144" height="60"> </body> Hello guys and gals , I am using one of the JavaScript codes provided at http://www.javascriptkit.com, and it works great on Chrome and Firefox. But Internet Explorer is giving me trouble Here is the HTML: Code: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta content="Keywords go here" name="keywords" /> <meta content="Description goes here" name="description" /> <meta content="This website is coded and maintained by ***** " name="author" /> <meta content="@2004 ***** " name="copyright" /> <meta http-equiv="Content-Style-Type" content="text/css2" /> <title>Concepto MV</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link href='http://fonts.googleapis.com/css?family=Comfortaa:400,700' rel='stylesheet' type='text/css'> <!--Website coded and maintained by Alexandra barvo Copyright @2011 w ww.alexandrabarvo.com --> </head> <body> <div id="background"></div><!--Backgroung--> <div id="wrapper"> <div id="nav"> <div id="logo"> <img src="images/logo.png"/> </div><!--logo--> <ul id="main_nav"> <li><a class="active" href="index.html">HOME</a></li> <li>|</a></li> <li><a href="about.html">OUR COMPANY</a></li> <li>|</a></li> <li><a href="services.html">SERVICES</a></li> <li>|</a></li> <li><a href="contact.html">CONTACT US</a></li> </ul> <ul id="social"> <li><a href="http://www.twitter.com" target="blank"><img src="images/twitter.png" border="0"/></a></li> <li><a href="http://www.flickr.com" target="blank"><img src="images/flickr.png" border="0"/></a></li> <li><a href="http://www.facebook.com" target="blank"><img src="images/facebook.png" border="0"/></a></li> </ul> </div><!--nav--> <div id="slideshow"> <script type="text/javascript"> // Flexible Image Slideshow- By JavaScriptKit.com (http://www.javascriptkit.com) // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/ // This notice must stay intact for use var ultimateshow=new Array() //ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"] ultimateshow[0]=['images/render1.jpg', '', ''] ultimateshow[1]=['images/render2.jpg', '', ''] ultimateshow[2]=['images/render3.jpg', '', ''] //configure the below 3 variables to set the dimension/background color of the slideshow var slidewidth="900px" //set to width of LARGEST image in your slideshow var slideheight="400px" //set to height of LARGEST iamge in your slideshow var slidecycles="3" //number of cycles before slideshow stops (ie: "2" or "continous") var randomorder="no" //randomize the order in which images are displayed? "yes" or "no" var preloadimages="yes" //preload images? "yes" or "no" var slidebgcolor='white' //configure the below variable to determine the delay between image rotations (in miliseconds) var slidedelay=3000 ////Do not edit pass this line//////////////// var ie=document.all var dom=document.getElementById var curcycle=0 if (preloadimages=="yes"){ for (i=0;i<ultimateshow.length;i++){ var cacheimage=new Image() cacheimage.src=ultimateshow[i][0] } } var currentslide=0 function randomize(targetarray){ ultimateshowCopy=new Array() var the_one var z=0 while (z<targetarray.length){ the_one=Math.floor(Math.random()*targetarray.length) if (targetarray[the_one]!="_selected!"){ ultimateshowCopy[z]=targetarray[the_one] targetarray[the_one]="_selected!" z++ } } } if (randomorder=="yes") randomize(ultimateshow) else ultimateshowCopy=ultimateshow function rotateimages(){ curcycle=(currentslide==0)? curcycle+1 : curcycle ultcontainer='<center>' if (ultimateshowCopy[currentslide][1]!="") ultcontainer+='<a href="'+ultimateshowCopy[currentslide][1]+'" target="'+ultimateshowCopy[currentslide][2]+'">' ultcontainer+='<img src="'+ultimateshowCopy[currentslide][0]+'" border="0">' if (ultimateshowCopy[currentslide][1]!="") ultcontainer+='</a>' ultcontainer+='</center>' if (ie||dom) crossrotateobj.innerHTML=ultcontainer if (currentslide==ultimateshow.length-1) currentslide=0 else currentslide++ if (curcycle==parseInt(slidecycles) && currentslide==0) return setTimeout("rotateimages()",slidedelay) } if (ie||dom) document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>') function start_slider(){ crossrotateobj=dom? document.getElementById("slidedom") : document.all.slidedom rotateimages() } if (ie||dom) window.onload=start_slider </script> </div><!--slideshow--> <div class="push"></div><!--push--> </div><!--wrapper--> <div class="footer"> <p id="copy">Copyright © 2012</p> </div><!--footer--> </div><!--body--> </body> </html> And here is the CSS Code: @charset "utf-8"; /* CSS Document */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; } body{ background:url(../images/bg.jpg) repeat; padding: 0px; font: 12px 'Comfortaa', Helvetica, sans-serif; color: #CCC; } #wrapper{ margin:0 auto 75px auto; width:960px; min-height: 100%; height:auto !important; height:100%; } #background{ background:url(../images/nav_bg.png) repeat-x; position:absolute; left:0; top:35px; width:100%; height:100%; z-index:-1; } #website{ position:absolute; left:0; top:0; width:100%; height:100%; z-index:99; } #nav{ /*background: url(../images/nav_bg.png) repeat-x;*/ width: 100%; height: 75px; margin-top: 35px; margin-bottom: 75px; } #logo{ margin-left:40px; float:left; } #main_nav{ margin-left: 22px; } ul#main_nav{ list-style:none; float:left; margin-top: 38px; } ul#main_nav li{ display:inline; padding-left:7px; font-size:14px; } ul#main_nav a{ text-decoration:none; color:#ccc; } ul#main_nav a:hover{ text-decoration:none; color:#666; } ul#social{ list-style:none; float:left; margin-top: 34px; margin-left: 22px; } ul#social li{ display:inline; padding-left:10px; font-size:18px; } ul#social a{ text-decoration:none; color:#ccc; } ul#social a:hover{ text-decoration:none; color:#666; } #slideshow{ width:900px; height:400px; border:#101010 solid 5px; padding: 0px; margin: 0px auto; } .footer{ text-align:center; background-color: #000; padding: 37px 0px 0px 0px; margin:0px; width:100%; background:url(../images/nav_bg.png) repeat-x; } .footer, .push{ height: 75px; } Can anyone tell me of I am doing something wrong, or if I just need to use another code for the slideshow to work on ie? Thank you so much for you time. Ale Hello, looking for simple javascript slideshow script, similar to this: http://www.jimex.co.jp/veh_details.php?id=4541 I like the mousover effect when the main image is changed once the mouse is over the thumbnails on the right hand side. Has anyone got something like this? Thanks Hello - My question revolves around a photo slider that will automatically advance to the next photo in a matter of seconds. . . Before you write this thread off as, 'GO GOOGLE IT, THERE'S TONS OF CODE ALREADY OUT THERE IN THREADS LIKE THIS'. . . The tricky part of this is, I already have a photo slider that you advance by a button click and it transitions 2 portions of the page. It is a custom module in Joomla that just basically uses some custom HTML to display a picture on the left and text on the right. . .and you click the button and it advances to another picture and different text to match the image. HERE IS MY CURRENT HTML THAT DISPLAYS THE IMAGE AND TEXT Code: <div class="images"><!-- first slide --> <div><img class="img-slider" src="images/stories/slider_img_1.jpg" border="0" /> <span class="slider-text-indent"> <h3 class="slider-titile">We listen.</h3> <span class="slider-text">Tired of unreliable computer consultants who are impossible to reach, nickel and dime you, and fail to deliver results that you deserve?<br /><br />ABC Computers is here to help you!</span> </span></div> <!-- second slide --> <div><img class="img-slider" src="images/stories/slider_img_2.jpg" border="0" /> <span class="slider-text-indent"> <h3 class="slider-titile">We Guarantee.</h3> <span class="slider-text">We are committed to doing whatever is necessary, period. In our 25 history, we have never had a failed implementation; we guarantee yours will not be the first.</span> </span></div> <!-- third slide --> <div><img class="img-slider" src="images/stories/slider_img_3.jpg" border="0" /> <span class="slider-text-indent"> <h3 class="slider-titile">We Care.</h3> <span class="slider-text">We treat your network as if it was our own. We protect your data as if it was ours. We don't look at your budget as a mine of money; we won't ask you to spend one dollar that we wouldn't spend on our own network!</span> </span></div> </div> <p><a class="backward">prev</a> <a class="forward">next</a></p> <!-- the tabs --> <div class="tabs"><a></a> <a></a> <a></a></div> Again, I would like to make this advance automatically through javascript (or perhaps there's a better way). . . but I do not want to lose the functionality of moving it manually with the button too. Is this possible to do and if so, does anyone have suggestions? Typically this isn't an issue for me to figure out but since I already have it how the client wants it to look, they basically want it to move automatically as if someone pushed the button. . .but still keep the manual button to advance and reverse it. Thank you in advance for any advice or help on this matter. Hi everyone, How can I achieve this? I need to get my drop down menu go over the javascript slideshow going on in this page: www.kimikal.com/store It works on all browsers except for IE, which hides the menu behind the js slideshow. Any help would be greatly appreciated! Hi, Im using the following javascript to cycle through 3 images on my website header. http://www.dynamicdrive.com/dynamici...nslideshow.htm However, I have put it in a div layer and it works fine, except in Internet explorer, if you load the page in a small window and then maximise, it moves out of position. Similarly if you open the page maximised, and then make the page smaller, it again moves out of position. My page layout is centered on the web page. is there anyone who could help me? My slideshow links will only open inside my inline frame. I'm sure there's something simple I need to change in the code to make it open full screen. Here is my code. Any help would be so much appreciated! Thank you. Shawnel <head> <style type="text/css"> .style1 { vertical-align: top; } </style> </head> <script type="text/javascript"> <!-- //preload images var image1=new Image() image1.src="Images/Picture Box/PictureBox1.jpg" var image2=new Image() image2.src="Images/Picture Box/PictureBox2.jpg" var image3=new Image() image3.src="Images/Picture Box/PictureBox3.jpg" var image4=new Image() image4.src="Images/Picture Box/PictureBox4.jpg" var image5=new Image() image5.src="Images/Picture Box/PictureBox5.jpg" //--> </script> <body style="margin-top: 0"> <a href="javascript:slidelink()"><img src="Images/Picture Box/PictureBox1.jpg" name="slide" border="0" width="539" height="314" class="style1" /></a> <script type="text/javascript"> <!-- var step=1 var whichimage=1 function slideit(){ if (!document.images) return document.images.slide.src=eval("image"+step+".src") whichimage=step if (step<5) step++ else step=1 setTimeout("slideit()",3000) } slideit() function slidelink(){ if (whichimage==1) window.location="learnmore.htm" else if (whichimage==2) window.location="contactus.htm" else if (whichimage==3) window.location="hungerheroes.htm" else if (whichimage==4) window.location="donate.htm" else if (whichimage==5) window.location="volunteer.htm" } //--> </script> |