JavaScript - Using Dynamically Populating A Javascript Image Slideshow- Fade Effect?
http://www.javascriptkit.com/javatut...rnalphp2.shtml
Anyone have a decent way of adding a fade affect to this script? Similar TutorialsPHP Code: <!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" /> <title>Untitled Document</title> <script type="text/javascript"> <!-- var image1=new Image() image1.src="images/slideshow/image001.jpg" var image2=new Image() image2.src="images/slideshow/image002.jpg" var image3=new Image() image3.src="images/slideshow/image003.jpg" var image4=new Image() image4.src="images/slideshow/image004.jpg" var image5=new Image() image5.src="images/slideshow/image005.jpg" var image6=new Image() image6.src="images/slideshow/image006.jpg" var image7=new Image() image7.src="images/slideshow/image007.jpg" var image8=new Image() image8.src="images/slideshow/image008.jpg" var image9=new Image() image9.src="images/slideshow/image009.jpg" var image10=new Image() image10.src="images/slideshow/image010.jpg" var image11=new Image() image11.src="images/slideshow/image011.jpg" var image12=new Image() image12.src="images/slideshow/image012.jpg" var image13=new Image() image13.src="images/slideshow/image013.jpg" var image14=new Image() image14.src="images/slideshow/image014.jpg" var image15=new Image() image15.src="images/slideshow/image015.jpg" var image16=new Image() image16.src="images/slideshow/image016.jpg" var image17=new Image() image17.src="images/slideshow/image017.jpg" var image18=new Image() image18.src="images/slideshow/image018.jpg" var image19=new Image() image19.src="images/slideshow/image019.jpg" var image20=new Image() image20.src="images/slideshow/image020.jpg" //--> </script> </head> <body> <img src="images/slideshow/image001.jpg" name="slide"> <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<20) step++ else step=1 //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500) } slideit() //--> </script> </body> </html> Hello all! This is my first time in the forum and I have been reading for a while. The information in here appears to be very accurate and useful. I am new to JavaScript. I have been programming sites for a while but have been using Flash for most of my animation and never really got into the ActionScript. Thanks to Apple... I can no longer use that crutch. So as I post in this forum please understand 2 things: 1 I am a beginner in JavaScript and 2. I want to learn not just copy, paste and move on! Here is my issue: I have made a VERY SIMPLE slide show and it works perfectly. However, Now I want to add a fade in and out effect to the code. I have seen this done with the CSS opacity(alpha) and that seems to be the simplist way. However, I am having trouble fitting this into my code. Any direction in this matter would be great! Thanks so much! Code: var step=1 function switchImg() { if (!document.images) return document.images.slide.src=eval("image"+step+".src") if (step<9) step++ else step=1 setTimeout("switchImg()",3500) } switchImg() Hello - I'm trying to add a fade effect between slideshow transitions. The script I'm building from is the Rich HTML Slideshow script which appears below. The slides that rotate are wrapped in <div> tags with a class of "dyncontent" and I've managed to make the slideshow transition just fine, but not with any kind of fade effect. It just "snaps" from one slide to the next. Is this a fairly simple addition? Thanks! <script type="text/javascript"> if (document.all || document.getElementById){ //if IE4 or NS6+ document.write('<style type="text/css">\n') document.write('.dyncontent{display: none; width: 250px; height: 60px;}\n') document.write('</style>') } var curcontentindex=0 var messages=new Array() function getElementByClass(classname){ var inc=0 var alltags=document.all? document.all : document.getElementsByTagName("*") for (i=0; i<alltags.length; i++){ if (alltags[i].className==classname) messages[inc++]=alltags[i] } } function rotatecontent(){ //get current message index (to show it): curcontentindex=(curcontentindex<messages.length-1)? curcontentindex+1 : 0 //get previous message index (to hide it): prevcontentindex=(curcontentindex==0)? messages.length-1 : curcontentindex-1 messages[prevcontentindex].style.display="none" //hide previous message messages[curcontentindex].style.display="block" //show current message } window.onload=function(){ if (document.all || document.getElementById){ getElementByClass("dyncontent") setInterval("rotatecontent()", 2000) } } </script> Hello everybody! This is my first post at CodingForums! I'm currently designing a wordpress theme, and I require a bit of javascript for a hover effect. I'm using Wordpress Jquery + Jquery Color Animations plugin. The structu I use a div (class="post") as a container for the wordpress post, and within the "post" div, I have a span (class="title") which I use to display the title of the post. What I want to do is: when the user hovers over (OnMouseOver) "post" div: ".title" spans's background color fades from black to red. when the user hovers out (OnMouserOut) "post" div: ".title" spans's background color fades back to black. The Code Code: $j(document).ready(function(){ $j(".posts").hover(function(){ $j (".posts .title").animate({ backgroundColor: "#FF0062" }, 300); },function(){ $j(".posts .title").animate({ backgroundColor: "#231F20" }, 300); }); }); The Problem The code works, except when the user hovers over any "post" div, all "title" span change color. So my question is, how do I target the code to address ONLY the "title" span in the "post" div that is in hover state? Any help would be greatly appreciated, Cheers, Drew. I need to have an image hyperlinked to a js function that fades text elswhere on the page. I imagine it looks something like <a href="(some js function or somethingrather"><img src="theimg.png"></a>, but how do I do it exactly? I would like code that I can just copy and paste in my header that is set to fade a specific line of text, and be able to hyperlink and image to initiate the js. Please help. Carson www.carsonkahn.com Hi, I have problem with javascript for image effects... Here is the LINK... login with theese nick and pass: nick: google pass: googleads the problem: When you log into, on the top of the page are 4 images with fade effect... But effect is wrong. When I came first I see those images in full collors. How to change my script to show them in grey when I first came? Thanks in advance... Hi, Please see URL http://backstageweb.net/Salon/indexslides2.htm. (code is below, original source: http://javascript.internet.com/misce...lide-show.html The slide show cross-fade effect in this script works in IE, but not in FF. I know there are better scripts I could use, but I like this one because of its simplicity (doesn't require any accompanying CSS, etc). But I need it to work in all browsers. Is there a simple fix here? Thanks, John Code: <head> <script type="text/JavaScript"> <!-- Original: CodeLifter.com (support@codelifter.com) --> <!-- Web Site: http://www.codelifter.com --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin // Set slideShowSpeed (milliseconds) var slideShowSpeed = 5000; // Duration of crossfade (seconds) var crossFadeDuration = 3; // Specify the image files var Pic = new Array(); // to add more images, just continue // the pattern, adding to the array below Pic[0] = 'images/01.jpg' Pic[1] = 'images/02.jpg' Pic[2] = 'images/03.jpg' Pic[3] = 'images/04.jpg' Pic[4] = 'images/05.jpg' // do not edit anything below this line var t; var j = 0; var p = Pic.length; var preLoad = new Array(); for (i = 0; i < p; i++) { preLoad[i] = new Image(); preLoad[i].src = Pic[i]; } function runSlideShow() { if (document.all) { document.images.SlideShow.style.filter="blendTrans(duration=2)"; document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"; document.images.SlideShow.filters.blendTrans.Apply(); } document.images.SlideShow.src = preLoad[j].src; if (document.all) { document.images.SlideShow.filters.blendTrans.Play(); } j = j + 1; if (j > (p - 1)) j = 0; t = setTimeout('runSlideShow()', slideShowSpeed); } // End --> </script> </head> Code: <body onLoad="runSlideShow()"> Code: <div id="slides"> <img src="images/01.jpg" name='SlideShow' width="380" height="541"> </div> okay i have a problem...i get the content of my rows from my database... the problem is when there is 4 rows... and i try to click on the 1st row... instead of it being deleted the 3rd row is deleted.. when i click on the 2nd row... the 4th row is delete... the moveicon.gif is the image for deleting the row.. there is no problem when i remove the javascript...but when i applied it i noticed the poblem Code: <table width="759" border="0"> <tr> <td colspan="5"><span class="style8">Confirmed Request</span> </td> </tr> <tr> <td width="105" bgcolor="#408080"><span class="style5">Type</span></td> <td width="463" bgcolor="#408080"><span class="style5">Topic</span></td> <td width="108" bgcolor="#408080"><span class="style5">Date</span></td> <td width="25" bgcolor="#408080"><div align="center"></div></td> <td width="36" bgcolor="#408080"><div align="center"></div></td> </tr> <%@ page import="com.sun.rowset.CachedRowSetImpl;" %> <% int i = 0; CachedRowSetImpl crset3 = new CachedRowSetImpl(); crset3 = view.home2(); while (crset3.next()) { String day3 = crset3.getString("dep_date"); String[] monthcol2= day3.split("-"); year = Integer.parseInt(monthcol2[0]); month = Integer.parseInt(monthcol2[1]); day= Integer.parseInt(monthcol2[2]); m=""; if(month==1) { m="Jan"; } else if (month==2) { m="Feb"; } else if (month==3) { m="March"; } else if (month==4) { m="April"; } else if (month==5) { m="May"; } else if (month==6) { m="June"; } else if (month==7) { m="July"; } else if (month==8) { m="Aug"; } else if (month==9) { m="Sept"; } else if (month==10) { m="Oct"; } else if (month==11) { m="Nov"; } else if (month==12) { m="Dec"; } if(i==0) { %> <tr> <script src="images/jquery-latest.js"></script> <script type="text/javascript"> <!-- function confirmation1(){ var answer = confirm("Do you want to move this to archives?") if (answer){ $("#movieIcon").parents("tr").fadeOut("slow"); window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>"; } else{ } } //--> </script> <td scope="row"><fade1><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %> </span> </div></fade1></td> <td scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_name")%></a> </span> </div></td> <td > <span class="style7"> <% out.println(day);%> <% out.println("-");%> <% out.println(m);%> <% out.println("-");%> <% out.println(year);%> </span></td> <td ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=yes,scrollbars=yes,status=yes,width=640,height=500'); if (chw != null) chw.focus(); return false"><img src="../Chapters/images/reporticon.gif" border="0"></a></div></td> <td ><div align="center"><img id="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" onClick="confirmation1()"/></div></td> </tr> <% i=1; } else { %> <tr> <script type="text/javascript"> <!-- <!-- function confirmation(){ var answer = confirm("Do you want to move this to archives?") if (answer){ $("#movieIcon1").parents("tr").fadeOut("slow"); window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>"; } else{ } } //--> //--> </script> <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %></span> </div></td> <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"><%= crset3.getString("dep_name")%> </span> </div></td> <td bgcolor="#CCCCCC"> <span class="style7"> <% out.println(day);%> <% out.println("-");%> <% out.println(m);%> <% out.println("-");%> <% out.println(year);%> </span></td> <td bgcolor="#CCCCCC"> <a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=no,scrollbars=yes,status=no,width=640,height=500'); if (chw != null) chw.focus(); return false"><div align="center"><img src="../Chapters/images/reporticon.gif" border="0"></div> </a></td> <td bgcolor="#CCCCCC" ><div align="center"><img id="movieIcon1" src="images/moveicon.gif" width="29" height="29" border="0" onClick="confirmation()"></div></td> </tr> <% i=0; } } %> </table> I am currently trying to convert a relatively simple slide effect in javascript to a fade effect, I have attached the code below and be grateful if anyone can help, var slider = null; var slider_next = null; $(function () { var interval = setInterval('rotate_slider()', 11000); pos = (window.location.pathname == "/" || window.location.pathname == "/home" ? '1280' : '1280'); $('#featuredSlider > div:not(:first)').attr('style','position:absolute;left:'+ pos +'px;width:1280px'); $('#featuredSlider > div:first').next().attr('style','position:absolute;left:0px;width:1280px'); $('#featuredShortcuts > div').click( function() { clearInterval(interval); sliders = $('#featuredSlider > div:not(:first)'); sliders.css({"left": "1280px", "opacity": 0}); var curr_div = $(this); var selected_div = $('#featuredShortcuts > div.selected'); selected_div.toggleClass('selected'); curr_div.toggleClass('selected'); sliders.eq( parseInt(selected_div.attr('id').substr(1, 1)) ).animate({"left": "-=1280px", "opacity": 0}, 1000); sliders.eq( parseInt(curr_div.attr('id').substr(1, 1)) ).animate({"left": "0px", "width": "1280px", "opacity": 1}, 1000); }); }); function rotate_slider() { var next = null; var curr_div = $('#featuredShortcuts > div.selected'); if( $('#featuredShortcuts > div:last').hasClass('selected') ) { next = $('#featuredShortcuts > div:first'); } else { next = curr_div.next(); } curr_div.toggleClass('selected'); next.toggleClass('selected'); if( ! slider ) { slider = $('#featuredShortcuts').next(); slider_next = slider.next(); } else if ( slider_next.html() == $('#featuredSlider > div:last').html() ) { slider = slider.next(); slider_next = $('#featuredShortcuts').next(); } else if ( slider.html() == $('#featuredSlider > div:last').html() ) { slider = $('#featuredShortcuts').next() slider_next = slider_next.next(); } else { slider = slider.next(); slider_next = slider.next(); } slider.animate({"left": "-=1280px", "opacity": 0}, 1000); slider_next.animate({"left": "0px", "width": "1280px","opacity": 1}, 1000, function () { slider.css('left', '1280px') }); } Hi! I'm wondering if somebody here could help me please. I'm trying to develope the image slideshow using PHP and JavaScript. The idea is that the PHP file gets random images from the folder, i'm using session to prevent repeating the same image and then JavaScript generates the fade slideshow using that PHP file. I've come up with the solution to use two img tags in the HTML page, so JavaScript then swap them around and play with opacity, but unfortunately couldn't make it work. Everything I have tried in JavaScript didn't work properly. I'd be grateful for any help and advice guys. Thank you. My PHP code: PHP Code: <?php class images { var $images = Array(); var $imgDir = 'images/'; function getImages() { $images = Array(); if ($dir = opendir($this->imgDir)) { while(($file = readdir($dir)) !== false) { if(preg_match('#(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)#i', $file)) $images[] = $file; } closedir($dir); } return $images; } function getNextImage() { if (($images = $this->getImages()) !== false) { session_start(); if (!isset($_SESSION['image'], $images[$_SESSION['image']])) { $index = mt_rand(0, count($images)-1); } else { $index = $_SESSION['image'] == count($images)-1 ? 0 : $_SESSION['image']+1; } $_SESSION['image'] = $index; return $images[$index]; } return false; } function outputImage() { if (($file = $this->getNextImage()) !== false) { header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header('Expires: Wed, 9 Dec 1981 07:00:00 GMT'); // Date in the past header('Content-type: image/jpg'); readfile($this->imgDir.$file); exit(); } } } $img = new images(); $img->outputImage(); ?> My HTML page: Code: <html> <head> <title>Images</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <script type="text/javascript" src="javascript/slideshow2.js" language="javascript"></script> </head> <body onload="startSlideShow();"> <h1>Images</h1> <div id="imageWrap"> <div id="images"> <img id="sampleImgFade" src="images.php" alt="images" style="filter:progid:DXImageTransform.Microsoft.alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;" width="800" height="600" onload="coverLoaded(this);" /> <img id="sampleImg" src="images.php" width="800" height="600" alt="images" onload="mainLoaded();" /> </div> </div> </body> </html> CSS code: Code: #imageWrap { clear: both; } #images { position: relative; clear: both; } #sampleImgFade { position: absolute; top: 0px; left: 0px; } JavaScript code which doesn't work properly(just to show in which direction I'm going): Code: var img; var loaded = new Array(); loaded['start'] = true; loaded['main'] = false; loaded['cover'] = true; var fade = 0; var i = 0; function getImage() { img = new image(); img.src = "images.php"; } function coverLoaded(obj) { loaded['cover'] = true; setOpacity(obj, 100); window.setTimeout("startFade", 5000); } function mainLoaded() { loaded['main'] = true; if (loaded['start'] && loaded['cover'] && loaded['main']) startFade(); } function startFade() { loaded['start'] = false; loaded['main'] = false; loaded['cover'] = false; fade = window.setInterval("fadeIn()", 50); } function fadeIn() { var obj = document.getElementById("sampleImgFade"); var opacity = getOpacity(obj); if (opacity > 0) { setOpacity(obj, opacity-5); } else { window.clearInterval(fade); document.getElementById("sampleImg").src = "images.php?u="+i++; } } function getOpacity(obj) { if (obj.filters) { return obj.filters.item("DXImageTransform.Microsoft.Alpha").Opacity; } else if (obj.style.MozOpacity) { // mozilla return obj.style.MozOpacity*100; } else if (obj.style.KhtmlOpacity) { // konquerer return obj.style.KhtmlOpacity; } else { // not supported return 0; } } function setOpacity(obj, opacity) { if (obj.filters) { obj.filters.item("DXImageTransform.Microsoft.Alpha").Opacity = opacity; } else if (obj.style.MozOpacity) { // mozilla obj.style.MozOpacity = opacity/100; } else if (obj.style.KhtmlOpacity) { // konquerer obj.style.KhtmlOpacity = opacity; } } This is a really awesome script that I'm sure all of you can put to use if you haven't yet heard of it. However, I'm trying to get it to fade a background image on my css styled navigation for my a:hover. Here is the script with a little simple tutorial on how to set it up: http://bavotasan.com/tutorials/creat...r-fade-effect/ My only other knowledge is in PHP, so after about 2 hours of fail in this client-side language, I decided it was about time I should post where some experienced people can help. I really appreciate all time you spend on this, and don't think it will take a moderate Javascript programmer very long. This is the link to my site so far: http://matt.mw/help-request You can see the script working as it is on my little yellow MW logo on the right side of the navigation. So in my scenario, I am looking to fade button.png to button-hover.png (both repeating on the x axis). Any ideas? I wrote a simple javescript for a slideshow that cycles through images and displays where the image is but I am wondering how to pause the slideshow and then add in a fading effect. Any help would be appreciated. index.html PHP Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Page 1</title> <link rel="stylesheet" type="text/css" href="css.css"></link> <script language="JavaScript" type="text/javascript" src="js.js"></script> </head> <body onLoad="LoadMenu(); PlaceArrow();"> <table border="0" cellspacing="0" cellpadding="0" id="hmt" summary="layout" align="center"> <tr><td colspan="4"><div id="htop"><img border="0" width="240" height="40" alt="" src="img/homet.png"></div></td></tr> <tr valign="top"> <td id="hmtgut"><img border="0" width="50" height="250" alt="" src="img/homel.png"></td> <td id="hmtl"><img border="0" width="280" height="270" src="img/homelogo.png"></td> <td id="hmtr"> <script language="JavaScript" type="text/javascript"> <!-- //preload images var image1=new Image() image1.src="photos/slides/photo01.jpg" var image2=new Image() image2.src="photos/slides/photo02.jpg" var image3=new Image() image3.src="photos/slides/photo03.jpg" var image4=new Image() image4.src="photos/slides/photo04.jpg" var image5=new Image() image5.src="photos/slides/photo05.jpg" var image6=new Image() image6.src="photos/slides/photo06.jpg" var image7=new Image() image7.src="img/thumbarrow.png" var image8=new Image() image8.src="img/spacer.gif" var cphoto = Math.ceil(6*Math.random()); document.write('<div id="homephoto"><a href="javascript:slidelink()"><img border="0" name="photo" width="230" height="230" src="photos/slides/photo0'+cphoto+'.jpg"></a></div>'); var step=cphoto var whichimage=step function slideit() { if (!document.images) return document.images.photo.src=eval("image"+step+".src") whichimage=step if (step<6) { step=parseInt(Math.ceil(6*Math.random())) } else { step=1 } setTimeout("slideit()",3000) var i = "a" + whichimage document.images.a1.src=eval("image8.src") document.images.a2.src=eval("image8.src") document.images.a3.src=eval("image8.src") document.images.a4.src=eval("image8.src") document.images.a5.src=eval("image8.src") document.images.a6.src=eval("image8.src") document.images[i].src=eval("image7.src") } slideit() function slidelink() { if (whichimage==1) window.open('img.php?img=1','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=400') else if (whichimage==2) window.open('img.php?img=2','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=400') else if (whichimage==3) window.open('img.php?img=3','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=400') else if (whichimage==4) window.open('img.php?img=4','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=400') else if (whichimage==5) window.open('img.php?img=5','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=400') else if (whichimage==6) window.open('img.php?img=6','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=400') } //--> </script> <noscript> <div id="homephoto"> <img border="0" name="photo" width="230" height="230" src="photos/slides/photo01.jpg"> </div> </noscript> </td> <td id="mtmenu" valign="middle">Links Here</td> </tr> <tr> <td colspan="4"> <div id="hfoot"> <div id="hbot"><img border="0" width="240" height="20" alt="" src="img/homeb.png"></div> <div id="thumb1"> <div><img border="0" vspace="9" hspace="2" name="a1" width="30" height="6" alt="" src="img/spacer.gif"></div> <div><a onClick="LoadPhoto(1); return false;"><img border="0" width="30" height="30" src="photos/thumbs/photo01thumb.jpg"></a></div> </div> <div id="thumb2"> <div><img border="0" vspace="9" hspace="2" name="a2" width="30" height="6" alt="" src="img/spacer.gif"></div> <div><a onClick="LoadPhoto(2); return false;"><img border="0" width="30" height="30" src="photos/thumbs/photo02thumb.jpg"></a></div> </div> <div id="thumb3"> <div><img border="0" vspace="9" hspace="2" name="a3" width="30" height="6" alt="" src="img/spacer.gif"></div> <div><a onClick="LoadPhoto(3); return false;"><img border="0" width="30" height="30" src="photos/thumbs/photo03thumb.jpg"></a></div> </div> <div id="thumb4"> <div><img border="0" vspace="9" hspace="2" name="a4" width="30" height="6" alt="" src="img/spacer.gif"></div> <div><a onClick="LoadPhoto(4); return false;"><img border="0" width="30" height="30" src="photos/thumbs/photo04thumb.jpg"></a></div> </div> <div id="thumb5"> <div><img border="0" vspace="9" hspace="2" name="a5" width="30" height="6" alt="" src="img/spacer.gif"></div> <div><a onClick="LoadPhoto(5); return false;"><img border="0" width="30" height="30" src="photos/thumbs/photo05thumb.jpg"></a></div> </div> <div id="thumb6"> <div><img border="0" vspace="9" hspace="2" name="a6" width="30" height="6" alt="" src="img/spacer.gif"></div> <div><a onClick="LoadPhoto(6); return false;"><img border="0" width="30" height="30" src="photos/thumbs/photo06thumb.jpg"></a></div> </div> </div> </td> </tr> </table> </table> </body> </html> js.js PHP Code: function PlaceArrow() { if ( cphoto ) { carrow = "a" + cphoto; document.images[carrow].src = "img/thumbarrow.png"; } } function LoadPhoto (i) { if (document.images) { carrow = "a" + cphoto; document.images[carrow].src = "img/spacer.gif"; narrow = "a" + i; nphoto = "photo0" + i; document.images[narrow].src = "img/thumbarrow.png"; document.images['photo'].src = "photos/slides/" + nphoto + ".jpg"; cphoto = i; } } I've managed to get a slideshow to randomly display pictures, but each time I try to add a fade into it, it never seems to work. Can anyone give me some advice? <script language="javascript"> var delay=2500 //set delay in miliseconds var curindex=0 var randomimages=new Array() randomimages[0]="image1.jpg" randomimages[1]="image2.jpg" randomimages[2]="image3.jpg" var preload=new Array() for (n=0;n<randomimages.length;n++) { preload[n]=new Image() preload[n].src=randomimages[n] } document.write('<img name="defaultimage" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'">') function rotateimage() { if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length)))){ curindex=curindex==0? 1 : curindex-1 } else curindex=tempindex document.images.defaultimage.src=randomimages[curindex] } setInterval("rotateimage()",delay) </script> <p align="center">This free script provided by<br /> <a href="http://javascriptkit.com">JavaScript Kit</a></p> Hi, I'm attempting to add the following functionality to my site. Essentially, two images are displayed with a link "View More". The user clicks "View More" and the two images are replaced by two new images. This can be repeated as required. It's a basic form of slideshow I guess, but after some googling all the tutorials etc available seem to be more aimed at fully blown shows, whereas I believe my problem is much more simple. The images are contained in a directory and are numbered like so: img1.jpg, img2.jpg. img3.jpg and so on. the code I came up with so far is PHP Code: <script type="text/javascript" language="JavaScript"> start = '<img src="gallery/img'; end = '.jpg" width="150" height="200" />'; function getImage() { var n = Math.ceil(Math.random() * 10); // i have 10 images var FirstImg=(start+n+end); var n = Math.ceil(Math.random() * 10); var SecondImg=(start+n+1+end); } /* so now I think I have two variables: FirstImg = <img src="gallery/img1.jpg" width="150" height="200" /> SecondImg = <img src="gallery/img4.jpg" width="150" height="200" /> but i'm now unsure how i'd go about displaying this on the page. ideally the HTML generated would be: <div class="pics"> <p><FirstImg></p> <p><SecondImg></p> <a href="#" onClick="return getImage()">View More</a> </div> */ </script> Am I on the right lines here or am I way off?? Appreciate some pointers. thanks a lot. Hello good coders! Thanks to the wonderful script provided by coothead he http://www.codingforums.com/showthread.php?t=87036 I was wondering how I could adjust the transition/fade speed between the images in the script? I tried a couple of different ways, but I couldn't get it working. Does anyone know how I can adjust this in a cross-browser compatible way? 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"> <head> <title>multiple image maps</title> <base href="http://coothead.homestead.com/files/"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> /*<![CDATA[*/ #mapImage_holder { text-align:center; } #mapImage { border:1px solid #000; } /*//]]>*/ </style> <script type="text/javascript"> //<![CDATA[ var maps=new Array(); maps[0]='dots.gif,#dots'; maps[1]='map.jpg,#blood'; maps[2]='apple0.jpg,#apples'; var c=0; var speed=1000*10; //set for 10 secs, change to suit needs. function swapMap() { obj=document.getElementById('mapImage'); if(c==maps.length) { c=0; } obj.src=maps[c].split(',')[0]; obj.useMap=maps[c].split(',')[1]; c++; setTimeout('swapMap()',speed); } window.onload=swapMap; //]]> </script> </head> <body> <div id="mapImage_holder"> <img id="mapImage" src="dots.gif" alt="" usemap="#dots"/> </div> <div> <map id="dots" name="dots"> <area coords="85,40,110,65" href="http://www.bbc.co.uk" alt="" /> <area coords="225,100,250,125" href="http://www.itv.com/" alt=""/> <area coords="345,140,370,165" href="http://www.channel4.com/" alt=""/> <area coords="405,270,430,295" href="http://www.guardian.co.uk/" alt=""/> <area coords="35,290,60,315" href="http://www.independent.co.uk/" alt=""/> <area coords="605,460,630,485" href="http://www.thesun.co.uk/" alt=""/> </map> <map id="blood" name="blood"> <area coords="40,144,80,171" href="http://www.codingforums.com/" alt="" /> <area coords="112,144,152,171" href="http://www.w3schools.com/" alt="" /> <area coords="184,144,224,171" href="http://w3c.org/" alt="" /> <area coords="256,144,296,171" href="http://www.alistapart.com/" alt=""/> </map> <map id="apples" name="apples"> <area coords="0,0,116,146" href="http://www.axialis.com/" alt=""/> <area coords="124,0,236,146" href="http://www.photoshopsupport.com/" alt=""/> <area coords="244,0,360,146" href="http://www.photoshopuser.com/" alt=""/> <area coords="0,154,116,280" href="http://www.planetphotoshop.com/" alt=""/> <area coords="124,154,236,280" href="http://www.photoshopcafe.com/" alt=""/> <area coords="244,154,360,280" href="http://www.mozilla.com/" alt=""/> </map> </div> </body> </html> Hi everyone, I have a set of "buttons" that expand/collapse information onClick, using Javascript that look like this... Here is the CSS I used to create the look of the "buttons"... Code: div.btn_workshops { background-image: url(../images/btn_workshops_mid.gif); background-position: top left; background-repeat: repeat-x; cursor: pointer; height: 22px; margin-bottom: 1px; width: 330px; } div.btn_workshops_lt { background-image: url(../images/btn_workshops_lt.gif); background-position: 0 0; background-repeat: no-repeat; height: 100%; width: 100%px; } div.btn_workshops_rt { background-image: url(../images/btn_workshops_rt.gif); background-position: 100% 0; background-repeat: no-repeat; height: 100%; padding: 3px 12px 0px 12px; width: 100%px; } .hide { display: none; visibility: hidden; } .show { display: block; visibility: visible; } Here is the HTML that contains the "buttons" and the text that will appear when you click on the "buttons" to expand them. Keep in mind that everything collapses when you click on any of the "buttons" a second time. This is done, using Javascript. Code: <div class="btn_workshops" onclick="expandWorkshops('workshop1');flipArrow('arrow1')"> <div class="btn_workshops_lt"> <div class="btn_workshops_rt"> <span class="workshops_hd">Basic Ceramics</span> - Jennifer Thompson <img src="static/images/arrow_down.gif" width="9" height="5" alt="" title="" class="arrow" id="arrow1" /> </div> </div> </div> <div id="workshop1" class="hide">Instructor: Jennifer Thompson<br /> Dates: October 9, 16, 23, and 30<br /> Hours: 2:30pm - 5:30pm<br /> Tuition: $250</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at elit diam, quis vestibulum ligula. Ut sed orci nec erat egestas ornare a vel elit. In malesuada, lectus vitae sagittis tincidunt, urna libero pulvinar ipsum, non consectetur lectus nunc quis turpis. Ut vitae ipsum nulla, et pharetra nulla. Morbi semper, justo a dapibus sollicitudin, neque risus ultricies lectus, non iaculis elit velit in eros. Donec ultrices lobortis congue. Sed scelerisque tortor vel libero vulputate sit amet congue augue pulvinar.</p> </div> <div class="btn_workshops" onclick="expandWorkshops('workshop2')"> <div class="btn_workshops_lt"> <div class="btn_workshops_rt"> <span class="workshops_hd">Head Drawing and Painting</span> - Daniel Shoreman <img src="static/images/arrow_down.gif" width="9" height="5" alt="" title="" class="arrow" id="arrow2" /> </div> </div> </div> <div id="workshop2" class="hide">Instructor: Jennifer Thompson<br /> Dates: 2/19, 2/26, 3/5, and 3/12<br /> Time: 10am - 1pm<br /> Tuition: $275 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at elit diam, quis vestibulum ligula. Ut sed orci nec erat egestas ornare a vel elit. In malesuada, lectus vitae sagittis tincidunt, urna libero pulvinar ipsum, non consectetur lectus nunc quis turpis. Ut vitae ipsum nulla, et pharetra nulla. Morbi semper, justo a dapibus sollicitudin, neque risus ultricies lectus, non iaculis elit velit in eros. Donec ultrices lobortis congue. Sed scelerisque tortor vel libero vulputate sit amet congue augue pulvinar.</p> </div> <div class="btn_workshops" onclick="expandWorkshops('workshop3')"> <div class="btn_workshops_lt"> <div class="btn_workshops_rt"> <span class="workshops_hd">Figure Drawing</span> - Tom Hampton <img src="static/images/arrow_down.gif" width="9" height="5" alt="" title="" class="arrow" id="arrow3" /> </div> </div> </div> <div id="workshop3" class="hide">Instructor: Tom Hampton<br /> Dates: August 7 and 14<br /> Time: 9am - 4pm<br /> Tuition: $150 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at elit diam, quis vestibulum ligula. Ut sed orci nec erat egestas ornare a vel elit. In malesuada, lectus vitae sagittis tincidunt, urna libero pulvinar ipsum, non consectetur lectus nunc quis turpis. Ut vitae ipsum nulla, et pharetra nulla. Morbi semper, justo a dapibus sollicitudin, neque risus ultricies lectus, non iaculis elit velit in eros. Donec ultrices lobortis congue. Sed scelerisque tortor vel libero vulputate sit amet congue augue pulvinar.</p> </div> <div class="btn_workshops" onclick="expandWorkshops('workshop4')"> <div class="btn_workshops_lt"> <div class="btn_workshops_rt"> <span class="workshops_hd">Photographing Portraits</span> - Susan Lilianas <img src="static/images/arrow_down.gif" width="9" height="5" alt="" title="" class="arrow" id="arrow4" /> </div> </div> </div> <div id="workshop4" class="hide">Instructor: Susan Lilianas<br /> Dates: February 19 - April 23<br /> Time: 6pm - 9pm<br /> Tuition: $200 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at elit diam, quis vestibulum ligula. Ut sed orci nec erat egestas ornare a vel elit. In malesuada, lectus vitae sagittis tincidunt, urna libero pulvinar ipsum, non consectetur lectus nunc quis turpis. Ut vitae ipsum nulla, et pharetra nulla. Morbi semper, justo a dapibus sollicitudin, neque risus ultricies lectus, non iaculis elit velit in eros. Donec ultrices lobortis congue. Sed scelerisque tortor vel libero vulputate sit amet congue augue pulvinar.</p> </div> <div class="btn_workshops" onclick="expandWorkshops('workshop5')"> <div class="btn_workshops_lt"> <div class="btn_workshops_rt"> <span class="workshops_hd">Still Life Oil Painting</span> - Daniel Shoreman <img src="static/images/arrow_down.gif" width="9" height="5" alt="" title="" class="arrow" id="arrow5" /> </div> </div> </div> <div id="workshop5" class="hide">Instructor: Susan Lilianas<br /> Dates: June 5, 12, 19, and 26<br /> Time: 10am - 1pm<br /> Tuition: $200 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at elit diam, quis vestibulum ligula. Ut sed orci nec erat egestas ornare a vel elit. In malesuada, lectus vitae sagittis tincidunt, urna libero pulvinar ipsum, non consectetur lectus nunc quis turpis. Ut vitae ipsum nulla, et pharetra nulla. Morbi semper, justo a dapibus sollicitudin, neque risus ultricies lectus, non iaculis elit velit in eros. Donec ultrices lobortis congue. Sed scelerisque tortor vel libero vulputate sit amet congue augue pulvinar.</p> </div> Here is the JavaScript I used to create the expand/collapse effect... Code: //Expand Workshops function expandWorkshops(obj) { var workshop = document.getElementById(obj) if ( workshop.className != "hide" ) { workshop.className = 'hide' } else { workshop.className = 'show' } } Here is my problem. I added the downward, red arrows to give users a "hint" that the "buttons" will do some action if you click on them. By default, I have the arrows facing down to show that information will appear below the "button." Then once a user has expanded a block of information, I want the downward, red arrow to change to an upward, red arrow. I currently have that working, but it is only working "one way." In other words, when you click on any one of the "buttons," the arrow does change, but it does not change back to the default when you click on a "button" a second time to collapse the information. Here is what it looks like with one of the "buttons" expanded. As you can see, I was successfully able to change the downward arrow to an upward arrow after the information expanded below. This helps show that the text can collapse upward if you click on the "button" a second time. Again, my problem is I am unable to get the upward arrow to return to its default, downward arrow appearance. This is what it currently looks like when you click on the "button" a second time to collapse the information. As you can see, my expand/collapse effect works, and the text goes away, but I am unable to get the upward arrow to change back to the default, downward arrow. This is the function that I added to my JavaScript, which successfully changes the arrow from down to up onClick, but fails to return the arrow image to default when you click again. Code: function flipArrow() { if ( document.images("arrow1").src = "static/images/arrow_down.gif" ) { document.images("arrow1").src = 'static/images/arrow_up.gif' } else if ( document.images("arrow1").src = "static/images/arrow_up.gif" ) { document.images("arrow1").src = 'static/images/arrow_down.gif' } } This is the full JavaScript that includes the expand/collapse effect and the unsuccessful swap arrow effect so you can everything together. Code: //Expand Workshops function expandWorkshops(obj) { var workshop = document.getElementById(obj) if ( workshop.className != "hide" ) { workshop.className = 'hide' } else { workshop.className = 'show' } } function flipArrow() { if ( document.images("arrow1").src = "static/images/arrow_down.gif" ) { document.images("arrow1").src = 'static/images/arrow_up.gif' } else if ( document.images("arrow1").src = "static/images/arrow_up.gif" ) { document.images("arrow1").src = 'static/images/arrow_down.gif' } } The flipArrow function I wrote is just my latest attempt. Believe me, I've tried all kinds of things, including "if else," "if else if," "if." I've tried Variables, getElementById, and switched out all different kinds of methods and ID's. No matter what, I can't seem to get any combination to work. Don't get me wrong. One of the previous methods I tried might have been the correct one, but I most likely did not write it correctly. I am no JavaScript expert at all. The code that I currently have was partly found on the Internet and partly modified by me after hours and hours of research and troubleshooting. I'm very proud that I was able to get this far, but I'm getting to the point where I am spending all day and night, every day, trying to figure this out. I always search forums before posting in them. This is probably the second time I've ever posted in a forum. I hope it helps. Sorry to ramble on. I just want to make sure you have as many details and samples as possible so I do not get any questions or confusion. 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 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? I have search for about a week and still no luck. I need to dynamically display mutliple images using javascript, no hardcoding. The images have different categories. For ex. bellTower01.jpg, bellTower02.jpg...and fountain01.jpg, fountain02.jpg.... -Use JavaScript to display several images and scroll through them To display multiple thumbnails, arrange them into a small quantity (no more than 8 per page) Provide pagination I really really really need help. I have never done javascript before, so I'm still learning. I seriously checked out many threads and links but nothing works or is what I want. I hope someone can help me out and hopefully also allow me to become better at coding this kind of stuff. I am not allowed to code in php for this project. I can only use javascript to display the images. Also, I don't really need anything fancy, like slideshows or rotations, I just the image to appear when I select that specific category. I want to get the images from my folder/directory. Right now, I have it working as it just being hardcoded. Below is my code for my galleries page: <?php //creates a session..initializes session data session_start (); echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); ?> <!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" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Scenes of Purdue</title> <!-- Styling of the Webpage --> <link rel="stylesheet" type="text/css" href="css/style.css"/> <script src="js/prototype.js" type="text/javascript"></script> <script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script> <script src="js/lightbox.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="css/lightbox.css"/> </head> <body> <div id="shadowContainer"> <div id="mainContainer"> <div id="mainHeader"></div> <div id="topNav"> <ul> <li><a href="index.php">Home</a></li> <li><a href="galleries.php">Galleries</a></li> </ul> </div><div id="content"> <br /> <div class="clearfix"><h1>Select a Category to View</h1> <br /> <div class="paginationBar" id="paginationBar"> <select id="catDropDown" onchange="javascript:getCategory()"> <option value="-" selected="selected">Select a Category</option> <option value="bellTower">Bell Tower</option> <option value="fountain">Fountain</option> </select> </div> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /> <ul id="pagination"> </ul> <div id="r1c1"></div> <div id="r1c2"></div> <div id="r1c3"></div> <div id="r2c1"></div> <div id="r2c2"></div> <div id="r2c3"></div> <script type="text/javascript"><!-- var bellTowerArray = new Array(); bellTowerArray[0] = "bellTower01.jpg"; bellTowerArray[1] = "bellTower02.jpg"; bellTowerArray[2] = "bellTower03.jpg"; bellTowerArray[3] = "bellTower04.jpg"; bellTowerArray[4] = "bellTower05.jpg"; bellTowerArray[5] = "bellTower06.jpg"; bellTowerArray[6] = "bellTower07.jpg"; bellTowerArray[7] = "bellTower08.jpg"; bellTowerArray[8] = "bellTower09.jpg"; bellTowerArray[9] = "bellTower10.jpg"; bellTowerArray[10] = "bellTower11.jpg"; bellTowerArray[11] = "bellTower12.jpg"; bellTowerArray[12] = "bellTower13.jpg"; bellTowerArray[13] = "bellTower14.jpg"; bellTowerArray[14] = "bellTower15.jpg"; bellTowerArray[15] = "bellTower16.jpg"; var fountainArray = new Array(); fountainArray[0] = "fountain01.jpg"; fountainArray[1] = "fountain02.jpg"; fountainArray[2] = "fountain03.jpg"; fountainArray[3] = "fountain04.jpg"; fountainArray[4] = "fountain05.jpg"; fountainArray[5] = "fountain06.jpg"; fountainArray[6] = "fountain07.jpg"; fountainArray[7] = "fountain08.jpg"; fountainArray[8] = "fountain09.jpg"; fountainArray[9] = "fountain10.jpg"; fountainArray[10] = "fountain11.jpg"; fountainArray[11] = "fountain12.jpg"; fountainArray[12] = "fountain13.jpg"; fountainArray[13] = "fountain14.jpg"; fountainArray[14] = "fountain15.jpg"; fountainArray[15] = "fountain16.jpg"; fountainArray[16] = "fountain17.jpg"; fountainArray[17] = "fountain18.jpg"; var currentArray = new Array(); function getCategory() { if(document.getElementById("catDropDown").selectedIndex == 1) { currentArray = bellTowerArray; } else if(document.getElementById("catDropDown").selectedIndex == 2) { currentArray = fountainArray; }//if/else if(document.getElementById("catDropDown").selectedIndex > 0) { displayImages(0); doPagination(); } } function displayImages(start) { //r1c1 if(!(start > currentArray.length-1)) document.getElementById("r1c1").innerHTML = "<a id=\"r1c1_a\" href=\"images/regular/" + currentArray[start] + "\" rel=\"lightbox\" title=\"This is the static description\"><img src=\"images/th/thumb_" + currentArray[start] + "\" id=\"r1c1_img\" width=\"150\" height=\"150\" alt=\"This is the static description in alt\" title=\"Static title description\" /><"+"/a>"; else document.getElementById("r1c1").innerHTML = ""; //r1c2 if(!(start+1 > currentArray.length-1)) document.getElementById("r1c2").innerHTML = "<a id=\"r1c2_a\" href=\"images/regular/" + currentArray[start+1] + "\" rel=\"lightbox\" title=\"This is the static description\"><img src=\"images/th/thumb_" + currentArray[start+1] + "\" id=\"r1c2_img\" width=\"150\" height=\"150\" alt=\"This is the static description in alt\" title=\"Static title description\" /><"+"/a>"; else document.getElementById("r1c2").innerHTML = ""; //r1c3 if(!(start+2 > currentArray.length-1)) document.getElementById("r1c3").innerHTML = "<a id=\"r1c3_a\" href=\"images/regular/" + currentArray[start+2] + "\" rel=\"lightbox\" title=\"This is the static description\"><img src=\"images/th/thumb_" + currentArray[start+2] + "\" id=\"r1c3_img\" width=\"150\" height=\"150\" alt=\"This is the static description in alt\" title=\"Static title description\" /><"+"/a>"; else document.getElementById("r1c3").innerHTML = ""; //r2c1 if(!(start+3 > currentArray.length-1)) document.getElementById("r2c1").innerHTML = "<a id=\"r2c1_a\" href=\"images/regular/" + currentArray[start+3] + "\" rel=\"lightbox\" title=\"This is the static description\"><img src=\"images/th/thumb_" + currentArray[start+3] + "\" id=\"r2c1_img\" width=\"150\" height=\"150\" alt=\"This is the static description in alt\" title=\"Static title description\" /><"+"/a>"; else document.getElementById("r2c1").innerHTML = ""; //r2c2 if(!(start+4 > currentArray.length-1)) document.getElementById("r2c2").innerHTML = "<a id=\"r2c2_a\" href=\"images/regular/" + currentArray[start+4] + "\" rel=\"lightbox\" title=\"This is the static description\"><img src=\"images/th/thumb_" + currentArray[start+4] + "\" id=\"r2c2_img\" width=\"150\" height=\"150\" alt=\"This is the static description in alt\" title=\"Static title description\" /><"+"/a>"; else document.getElementById("r2c2").innerHTML = ""; //r2c3 if(!(start+5 > currentArray.length-1)) document.getElementById("r2c3").innerHTML = "<a id=\"r2c3_a\" href=\"images/regular/" + currentArray[start+5] + "\" rel=\"lightbox\" title=\"This is the static description\"><img src=\"images/th/thumb_" + currentArray[start+5] + "\" id=\"r2c3_img\" width=\"150\" height=\"150\" alt=\"This is the static description in alt\" title=\"Static title description\" /><"+"/a>"; else document.getElementById("r2c3").innerHTML = ""; } function doPagination() { var numpages = (currentArray.length / 6) +1; var numleft = currentArray.length % 6; document.getElementById("pagination").innerHTML = ""; for(i=0; i<numpages-1; i++) { document.getElementById("pagination").innerHTML += "<span onclick='displayImages("+ i*6 +")'>"+ (i+1) + "<"+"/span> "; } if(numpages <=1) { document.getElementById("pagination").innerHTML = ""; } } document.getElementById("catDropDown").selectedIndex = 0; --> </script> </div> </div> </div> <div id="footer"><a href="readme.php">Readme</a><br /> <div class="clearfix"> <div style="float: left"><a href="adminLogin.php" title="Admin Login" class="adminLoginAjax">Admin login</a></div> </div> </div> </div> </div> </body> </html> |