JavaScript - Making A Slideshow - Can't Find The Problem With My Code?!
I'm teaching myself how to build websites; up until now I have made websites using tables within tables and it's all fairly straight forward, now I realise that divs and css allow you to do soooo much more!
I have put these files in a temp folder on my website so not to over write the current site. Basically I have followed this online tutorial (http://www.cryer.co.uk/resources/jav...show_links.htm) but when I test the slideshow, it doesn't work. the link is: www.telecaretechnology.com/telecare2/index.html Since I have started writing this, my css file seems to have had a wobbly - I assume my problem is where I'm trying to use server-side include?? Is that the best way to add these files? the javascript I have used to make the slideshow run is he http://www.telecaretechnology.com/te...2/slideshow.js I would really appreciate any advice! Kind Regards, Jamie Similar TutorialsSo i purchased a template from template monster for wordpress. http://www.templatemonster.com/demo/28861.html On the front page when you click on the thumbnail it changes the big image in the middle. I can't figure out how for the life of me to make that image also a link. My main problem is the code below. img_b1.jpg is the full size image and image_1.jpg is the thumbnail image. When you click on the thumbnail it changes the big image in the middle. When I add a clickable href=" to the main image it breaks the whole chain. --------------------------------------------------------------------- <a class="thumb" name="leaf" href="<?php bloginfo('stylesheet_directory'); ?>/images/img_b1.jpg" title="Agrocore"> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/img_1.jpg" alt="Agrocore" /> </a> ------------------------------------------------------------------------ Full code below <div id="thumbs" class="navigation"> <ul class="thumbs noscript"> <li> <a class="thumb" name="leaf" href="<?php bloginfo('stylesheet_directory'); ?>/images/img_b1.jpg" title="Agrocore"> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/img_1.jpg" alt="Agrocore" /> </a> <div class="caption"> <div class="indent1">living set </div> <div class="image-desc">Cool looking but extremely functional and comfortable. The colours black and white dominate throughout.<br /> Sleek and stylish interior to suit your taste.</div> <div class="indent"><h4>Contemporary</h4></div> </div> </li> <li> <a class="thumb" name="leaf" href="<?php bloginfo('stylesheet_directory'); ?>/images/img_b2.jpg" title="ProClinique"> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/img_2.jpg" alt="ProClinique" /> </a> <div class="caption"> <div class="indent1">in grey</div> <div class="image-desc">Luxury living is being redefined and emphasis is being laid on comfortable living, without compromising on style, modest in the color codes</div> <div class="indent"><h4>Sitting room </h4></div> </div> </li> <li> <a class="thumb" name="leaf" href="<?php bloginfo('stylesheet_directory'); ?>/images/img_b3.jpg" title="Beauty"> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/img_3.jpg" alt="Beauty" /> </a> <div class="caption"> <div class="indent1">living set </div> <div class="image-desc">Cool looking but extremely functional and comfortable. The colours black and white dominate throughout.<br /> Sleek and stylish interior to suit your taste.</div> <div class="indent"><h4>Contemporary</h4></div> </div> </li> <li> <a class="thumb" name="leaf" href="<?php bloginfo('stylesheet_directory'); ?>/images/img_b4.jpg" title="Market"> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/img_4.jpg" alt="Market" /> </a> <div class="caption"> <div class="indent1">in grey </div> <div class="image-desc">Luxury living is being redefined and emphasis is being laid on comfortable living, without compromising on style, modest in the color codes</div> <div class="indent"><h4>Sitting room </h4></div> </div> </li> <li class="last"> <a class="thumb" name="leaf" href="<?php bloginfo('stylesheet_directory'); ?>/images/img_b5.jpg" title="Business"> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/img_5.jpg" alt="Business" /> </a> <div class="caption"> <div class="indent1">living set </div> <div class="image-desc">Cool looking but extremely functional and comfortable. The colours black and white dominate throughout.<br /> Sleek and stylish interior to suit your taste.</div> <div class="indent"><h4>Contemporary</h4></div> </div> </li> </ul> </div> </div> </div> NOT SURE WHAT IS GOING ON, WHEN I COMMENT OUT THE CREATE ARRAY FUNCTION EVERYTHING SEEMS TO WORK FINE, SO WHAT IS UP WITH THE CREATEARRAY FUNCTION???? Code: <!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" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Photoviewer</title> </head> <body bgcolor="#FFF1CC"> <h1><u> Viewer </u></h1> <p> <img id="myImage" src="InitialImage.jpg" width="444" height="293" alt="viewerImg" /> </p> <hr /> <!--Entry boxes--> <form action="" method="post"> <p>Photo's Folder <input type="text" id="photofold" value="umcp/" /><br /> </p> <p>Common Name <input type="text" id="commonName" value="college" /><br /> </p> <p> Start Photo Number <input type="text" id="Startval" value="1" /> </p> <p>End Photo Number <input type="text" id="Endval" value="1" /> </p> <!--Action buttons--> <p> <input type="button"id="displayShowButton" value="Slide Show" /> <input type="button"id="displayRandoButton" value="Random Slide Show" /> <input type="button"id="displayNextButton" value="Previous Slide" /> <input type="button"id="displayLastButton" value="Next Slide" /> </p> <!--Reset Button--> <p> <input type="reset" value="Reset" /> </p> </form> <script type="text/javascript"> /*<![CDATA[*/ /*setting global variables*/ var photosArrayGlobal; var photoIndexGlobal; var displayGlobal=document.getElementById("myImage") /* calling main */ main(); function main() { document.getElementById("displayShowButton").onclick= setSequential; document.getElementById("displayRandoButton").onclick=setRandom; } /*Generate the size of the photoarrays */ function createArray() { window.alert("create array"); if (number > 0) { window.alert("there are"+number+"photos in your range"); photosArrayGlobal= new Array (number); return photoArrayGlobal; getArrayPhotosNames(); } Else { window.alert("there is one photo in your range"); photosArrayGlobal = new Array (1); return photosArrayGlobal; getArrayPhotosNames(); } } /*Designate that either a random or a sequential order has been requested,sequential=1/random=0*/ function setSequential() { var mode= 1; window.alert("set sequential"); checkRange(); } function setRandom () { var mode= 0; window.alert("set random"); checkRange (); } /*make sure end is start is less than end*/ function checkRange() { window.alert("check range"); var Start= document.getElementById("Startval"); var Startnum = Start.value; var End = document.getElementById("Endval"); var Endnum = End.value if (Endnum < Startnum){ window.alert("Invalid Numbers"); } else { window.alert("correct input"); var range = Endnum - Startnum; window.alert(range); var number=Number(range); createArray (); } } /* This function will read the folder name, common name, start photo number, and end photo number and will return an array with the names of the photos that belong to the specified number range. Each photo's name consists of the folder name, followed by the common name, the photo's number and the ".jpg" extension*/ function getArrayPhotosNames () { window.alert("all done for now"); } /*]]>*/ </script> </body> </html> I found the code for how to create a basic slideshow on javascript kit. It tells you the code for 3 images. I am adding more images to my slide show, but when I go to preview it, it loops through the first 3 pictures only. Is there something else I need to change in order to get it to loop through all my pictures? Here is the code I got from the site: <html> <head> <script type="text/javascript"> <!-- var image1=new Image() image1.src="firstcar.gif" var image2=new Image() image2.src="secondcar" var image3=new Image() image3.src="thirdcar.gif" //--> </script> </head> <body> <img src="firstcar.gif" name="slide" width="100" height="56" /> <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> </body> </html> My code looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> <!-- var image1=new Image() image1.src="Model01.jpg" var image2=new Image() image2.src="Model02.jpg" var image3=new Image() image3.src="Model03.jpg" var image4=new Image() image4.src="Model04.jpg" var image5=new Image() image5.src="Model05.jpg" var image6=new Image() image6.src="Model06.jpg" var image7=new Image() image7.src="Model07.jpg" var image8=new Image() image8.src="Model08.jpg" var image9=new Image() image9.src="Model09.jpg" var image10=new Image() image10.src="Model10.jpg" var image11=new Image() image11.src="Model11.jpg" var image12=new Image() image12.src="Model12.jpg" var image13=new Image() image13.src="Model13.jpg" var image14=new Image() image14.src="Model14.jpg" var image15=new Image() image15.src="Model15.jpg" var image16=new Image() image16.src="Model16.jpg" var image17=new Image() image17.src="Model17.jpg" var image18=new Image() image18.src="Model18.jpg" var image19=new Image() image19.src="Model19.jpg" var image20=new Image() image20.src="Model20.jpg" //--> </script> <title>Untitled Document</title> </head> <body> <img src="file:///K|/Michaels Homes Web/Images/Model01.jpg" name="slide" width=500 height=375> <script type="text/javascript"> <!-- //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 3.0 seconds setTimeout("slideit()",3000) } slideit() //--> </script> </body> </html> This is just the code for the slideshow, not any of the code from the rest of my website. It does the same thing when I test it either the code only or the whole webpage. If I am missing something in the steps, please let me know. Thanks This is the script itself - no error messages are generated. Code: <script language="javascript" type="text/javascript"> function getXMLHTTPRequest() { try { req = new XMLHTTPRequest(); } catch(err1) { try { req = new ActiveXObject("Msxm12.XMLHTTP"); } catch(err2) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(err3) { req = false; } } } return req; } var http = getXMLHTTPRequest(); function getCattle(animal_id){ var myurl = 'find_cattle.php'; var CattleValue=animal_id; var modurl= myurl+"?d="+CattleValue; **************the alert returns the correct value from my selection and after than nothing, I never get my alert from the response portion alert("Looking For "+modurl); ******* http.open("GET", modurl, true); http.onreadystatechange=useHttpResponse; http.send(null); } function useHttpResponse(){ ************It never gets to this response alert("Made It To Response"); if (http.readyState == 4) { if(http.status == 200) { var ListValue = http.responseXML.getElementsByTagName("animal_id")[0]; document.getElementsById('cattle_data').innerHTML = animal_id.childNodes[0].nodeValue; } } } </script> thank you 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> Hey guys, this should be a very easy fix for someone who knows Javascript (which I don't). The following code allows the class "ul.slideshow-nav li" to control the navigation of the slideshow, I want to adjust this script to allow "ul.slideshow-nav li" AND "ul.slideshow-nav2 li" to do this, possible? Code: $slideshow = { context: false, tabs: false, timeout: 8000, fx: 'scrollLeft', slideSpeed: 900, tabSpeed: 900, init: function() { this.context = $('#content-slideshow'); this.tabs = $('ul.slideshow-nav li', this.context); this.tabs.remove(); this.startSlideshow(); }, startSlideshow: function() { $('div.slideshow > ul', $slideshow.context).cycle({ fx: $slideshow.fx, pager: $('ul.slideshow-nav', $slideshow.context), pagerAnchorBuilder: $slideshow.startTabs, befo $slideshow.Tabactive, timeout: $slideshow.timeout, speed: $slideshow.slideSpeed, fastOnEvent: $slideshow.tabSpeed, pauseOnPagerHover: true, pause: true }); }, startTabs: function(i, slide) { return $slideshow.tabs.eq(i); }, Tabactive: function(currentSlide, nextSlide) { var activeTab = $('a[href="#' + nextSlide.id + '"]', $slideshow.context); if(activeTab.length) { $slideshow.tabs.removeClass('on'); activeTab.parent().addClass('on'); } } }; $(function() { $slideshow.init(); }); hello i have a form which when the user hits "submit," the info in the textboxes is entered to a database. the only textbox which is not entered to the DB is an "age" textbox, which i need to verify to see if user is 18yrs or older. if user is not 18 years or older, they get an alert telling them they arent 18+. if they are, then the form submits this is my code so far, and i dont get any alerts when i enter an age younger than 18: Code: <head> <script language="text/javascript"> var age; document.getElementById("userage").value = age; if (age >=18) document.location="feedbacksaveanddisplay.php"; else { alert('Sorry, we can not let you in!') document.location="content.html"; } </script> </head> <form method = "post" action = "FeedbackSaveAndDisplay.php"> <input type = "hidden" name = "user" value = "test"/> <input type = "hidden" name = "pwd" value = "test"/> <p>Enter your name, feedback, score</p> <table> <tr> <td>Name</td> <td> <input type = "text" name = "name" style="width:150px; height:20px;" /> </td> </tr> <tr> <td>Feedback</td> <td> <input type = "text" name = "feedback" style="width:150px; height:20px;" /> </td> </tr> <tr> <td>Score</td> <td> <input type = "text" name = "score" style="width:150px; height:20px;" /> </td> </tr> <tr> <td>Product</td> <td> <input type = "text" name = "product" style="width:150px; height:20px;" /> </td> </tr> <tr> <td>Age</td> <td> <input type = "text" name = "age" style="width:150px; height:20px;" /> </td> </tr> <tr> <td colspan = "2"> <input type = "submit" value = "Submit" /> </td> </tr> </table> </form> any tips/advice on how to fix my code? the problem i think is in the javascript... will greatly appreciate any help thanks!! Hello: Many apologies if this is not an appropriate question here... but I have googled my fingers raw and haven't been able to find a script to do what I am looking for. I have little experience with JavaScript. I have a VBA script (code at the end of this post) that returns the date corresponding to a given occurrence of a given weekday, e.g. Ask it for the 3rd Tuesday in October 2012 and it gives you 16-OCT-2012. It defaults to current year if you don't pass the Year argument. It's a pretty simple script, but I need to either finds something in JavaScript that does the same thing, or convert the VBA code to JavaScript. I can't help but think that many people have already written scripts that do this. Any chance someone can lead me in a productive direction here? Regards, Steve Jones (update - I noticed the code didn't retain its formatting, so I attached a text file) -begin VBA code- Public Function xdate(m As Integer, n As Integer, wd As Integer, Optional y As Integer = 0) As Date '// m = 1-12 (Jan-Dec), n = 1-5 (1st-4th, last), wd = 1-7 (Sun-Sat), y = 1900-9999 or left blank for current year Select Case y Case 0 ' // Default. Use the current year. y = year(Date) Case 1900 To 9999 ' // treat the value as an explicit year Case -100 To -1, 1 To 100 ' // treat the value as an offset to be applied to the current year y = year(Date) + y Case Else ' // invalid value. Insert whatever error processing you like. End Select Select Case n Case 1 To 4 '// first through fourth Case 5 '// last. We need to check to see it fell within the month specified, if not, use 4. xdate = DateSerial(y, m, (8 - weekday(DateSerial(y, m, 1), (wd + 1) Mod 8)) + ((n - 1) * 7)) If month(xdate) <> m Then n = 4 End If Case Else ' // invalid value - insert error processing code here if you like. ' // Probably should check the other arguments as well. End Select xdate = DateSerial(y, m, (8 - weekday(DateSerial(y, m, 1), (wd + 1) Mod 8)) + ((n - 1) * 7)) End Function -end vba code- Dear Forum Members HI, I am no coder, however I am modifying my website and changing the slideshow to the one found on this website, most wonderful, the Cut & Paste JavaScript Slideshow( http://www.javascriptkit.com/script/.../jsslide.shtml ) I have it working now, and I have but one question, does the code include a way to limit the number of times that it cycles through the slides? So it just freezes on one photo after x number of cycles? many thanks, and happy holidays... Ok, I am in a small pickle here. I created a sidebar gadget for work originally with only 4 images that needed to cycle though it. Easy enough script done. Now they have 6 images that need to rotate through. Easy enough again, script done. The issue I have is now I have to re-push this updated html file to all 1000 PC's on my network. Plus every time a change is made I will have to do it again. And we change the images multiple times a month. So what I need help doing if its possible is to modify the html file i am listing below to have a second IF parameter that not only steps the image but also checks to see if the file is even there. This is the spot I need help at. Code: function slideit(){ if (!document.images) return document.images.slide.src=eval("image"+step+".src") whichimage=step if (step<10) step++ else step=1 I wanted to add another part to the IF statement like maybe. Code: If (step<10 && file_exists("http://www.akronlibrary.org/Gadget/Gadget Pic 1.bmp")) Basically a step that checks to see if I have at that moment a file named gadet pic 1. (I would do or statements for all of the file names) The point is to make this whole thing dynamic, so that I change image 1 on the server and every gadget on every PC looking for image 1 now see the new image. This way I just change the image file name when I want a different image to display. Same thing with the var for the slidelink function. points to a static named html file on my web server and I just change the redirect in the static named html file to go where i want it. I am by NO means a programmer, I am actually a network admin that came up with this idea and I am trying to fumble through it. Thanks in advance! Code: <html> <head> <meta hrrp-equiv="Content-Type" content="text/html; charset=Unicode" /> <style type="text/css"> body{ margin: 0px; width: 405px; height: 205px; font-family; Georgia; } </style> <script type="text/javascript"> var image1=new Image() image1.src="http://www.akronlibrary.org/Gadget/Gadget Pic 1.bmp" var image2=new Image() image2.src="http://www.akronlibrary.org/Gadget/Gadget Pic 2.bmp" var image3=new Image() image3.src="http://www.akronlibrary.org/Gadget/Gadget Pic 3.bmp" var image4=new Image() image4.src="http://www.akronlibrary.org/Gadget/Gadget Pic 4.bmp" var image5=new Image() image5.src="http://www.akronlibrary.org/Gadget/Gadget Pic 5.bmp" var image6=new Image() image6.src="http://www.akronlibrary.org/Gadget/Gadget Pic 6.bmp" var image7=new Image() image7.src="http://www.akronlibrary.org/Gadget/Gadget Pic 7.bmp" var image8=new Image() image8.src="http://www.akronlibrary.org/Gadget/Gadget Pic 8.bmp" var image9=new Image() image9.src="http://www.akronlibrary.org/Gadget/Gadget Pic 9.bmp" var image10=new Image() image10.src="http://www.akronlibrary.org/Gadget/Gadget Pic 10.bmp" </script> </head> <body> <a href="javascript:slidelink()"><img title="Akron-Summit County Public Library" name="slide" /></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<10) step++ else step=1 setTimeout("slideit()",6000) } slideit() function slidelink(){ if (whichimage==1) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 1 Link.html" else if (whichimage==2) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 2 Link.html" else if (whichimage==3) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 3 Link.html" else if (whichimage==4) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 4 Link.html" else if (whichimage==5) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 5 Link.html" else if (whichimage==6) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 6 Link.html" else if (whichimage==7) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 7 Link.html" else if (whichimage==8) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 8 Link.html" else if (whichimage==9) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 9 Link.html" else if (whichimage==10) window.location="http://www.akronlibrary.org/Gadget/Gadget Image 10 Link.html" } </script> </body> </html> Hi All, I accidentally damaged my slide show today and cant work out how to fix it. If you go to www.myav.com.au its on the home page. I had only links showing so I added the <ul id="slideshow"> tag and now I have the box coming up but its just blank. Any ideas? Thanks so much! hi everybody, I need a help about making a slideshow script which could work with IE and Firefox, the code I have for it is work only on the IE, so hope if any one could help me in this issue.
Hi, I have this code: Code: window.addEvent('domready',function(){ document.id('cool').addEvent('click',function() { light = new LightFace.IFrame({ height:400, width:800, url: 'http://google.com', title: 'Google!' }).addButton('Close', function() { light.close(); },true).open(); }); }); It's a piece from something called the lightface iframe. What I want to do is to have this code on my javascript page, that's included on the main page where I want to call it. I call on it like this: Code: <a href="#" id="cool">Edit general info</a> However this only works if it's on the main page, not when I have it on my js page. So what I want to do is to turn it into a function, because that I know works. Could anyone help me with this? Thanks in advance for your time! Hello, Below is the javascript I'm debugging (or trying to) but just can't see where the error is: The code should send a message "GOOODDD!!!" when the input box is empty (nothing typed in) and should send a message (BAAADD!!!) when a string of theee a's are typed in ("aaa"). The problem is that no matter what I type in the script ALWAYS sends me a "GOOODD!!" message. I guess it is a simple glitch but I just can't figure it out. I'd appreciate any help Thank You. Code: <script language="javascript" type="text/javascript"> <!-- function textCheck(that) { var mytext=document.getElementById("BLABLA") if (mytext == "aaa") alert("BAAAAADDDDD!!!!" + mytext.value); else alert(" GOOOODDDD!!!!" + mytext.value); } --> </script> </head> <body> <form id="form1" method="get" onsubmit="textCheck(this)" /> <input name="BLABLA" size="3" type="text"/> Input Data <br/><br/> <input name="Submit1" type="submit" value="submit" /> </body> </html> I'm not sure whether this is a javascript or CSS related problem so sorry if I've posted this in the wrong place. I'm modifying a slideshow plugin to fit my website and have changed some of the dimensions of the slides. Now the next slide is coming in from the wrong position on the right hand side. I'm not sure how to fix this, can someone please help? http://ah.mjtippet.com/ 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> Currently working on a slideshow for this website, and I've used the same code in the past but because I am now working with a wordpress template I'm having some problems. Link to slideshow The next image is loading underneath the current image and then moving up, which I need them images to stay in place of course. Code: <div id="lookbook"> <a href="http://www.axandapple.com/store/?cat=71" target="_self"><ul class="ppt"> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-1.jpg" ALT="Ax+Apple Presents The Witching Hour Collection"></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-2.jpg" ALT="Ax+Apple Nyx & Orion Necklaces"></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-3.jpg" ALT="Ax+Apple Odessa & Oracle Necklaces"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-4.jpg" ALT="Ax+Apple Jupiter & Naja Necklaces"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-5.jpg" ALT="Ax+Apple Nyx & Orion Necklaces"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-6.jpg" ALT="Ax+Apple Odessa & Oracle Necklaces and Snake Charmer Bracelet"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-7.jpg" ALT="Ax+Apple Jupiter & Naja Necklaces and Asteria Earrings"></img></li> </ul></a> <p style="text-align:center;"><button type="button" id="back">Back</button> <button type="button" id="stop">Pause</button> <button type="button" id="play">Play</button> <button type="button" id="fwd">Forward</button></p> </div> <p>2011 Ax+Apple</p> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $('.ppt li:gt(0)').hide(); $('.ppt li:last').addClass('last'); $('.ppt li:first').addClass('first'); $('#play').hide(); var cur = $('.ppt li:first'); var interval; $('#fwd').click( function() { goFwd(); showPause(); } ); $('#back').click( function() { goBack(); showPause(); } ); $('#stop').click( function() { stop(); showPlay(); } ); $('#play').click( function() { start(); showPause(); } ); function goFwd() { stop(); forward(); start(); } function goBack() { stop(); back(); start(); } function back() { cur.fadeOut( 1000 ); if ( cur.attr('class') == 'first' ) cur = $('.ppt li:last'); else cur = cur.prev(); cur.fadeIn( 1000 ); } function forward() { cur.fadeOut( 1000 ); if ( cur.attr('class') == 'last' ) cur = $('.ppt li:first'); else cur = cur.next(); cur.fadeIn( 1000 ); } function showPause() { $('#play').hide(); $('#stop').show(); } function showPlay() { $('#stop').hide(); $('#play').show(); } function start() { interval = setInterval( "forward()", 3000 ); } function stop() { clearInterval( interval ); } $(function() { start(); } ); </script> Code: #lookbook{ position:relative; } ul.ppt{ position:absolute; height:699px; } .ppt li{ list-style-type:none; position:absolute; top:0px; left:0px; height:699px; } .ppt img{ background-color:#FFF; padding:5px; top:0px; position:absolute; } #lookbook p{ text-align:center; z-index:99; } #lookbook button{ background-color:#FFF; border:0; padding:0 3px 0 3px; color:#000; font:12px "Courier", "Courier New", Courier, monospace; } Sorry, I'm new in javascript and i can't understand what's wrong with my code.. I've spent some time searching for the solution, but i give up. For some of you may it be just a piece of cake, so maybe you can look at this: Code: <script language="javascript"> var n_pics = 3; var current = 1; var opacity = 1; var opacity_IE = 100; function fade(how) { if(how==0) { if(opacity>0) { opacity = opacity - 0.1; } else return; } else { if(opacity<1) { opacity = opacity + 0.1; opacity_IE = opacity * 100; } else return; } document.getElementById('fade_show').style = 'opacity:'+opacity+'; filter:alpha(opacity='+opacity_IE+')'; //break_point 1 var temp = 'fade('+how+')'; setTimeout(temp, 1000); } function main_loop() { fade(0); //break_point 2 if(current == n_pics) { current = 1; } else { current = current + 1; } document.getElementById('fade_show').innerHTML = '<img src="images/fade_show/'+current+'.jpg" />'; fade(1); main_loop(); } </script> </head> <body onload="main_loop();"> fade(0) means to fade out, and fade(1) - to fade in. on IE i get 'Member Not found' on break_point 1 and too much recursion at breake_point 2 can you help me? 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? |