<?xml version="1.0"?>
<rss version="2.0">
 <channel>
  <title>Javascript slideshow | WPDFD.com Forums</title>
  <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/</link>
  <description>A Scripting forum thread at WPDFD.com</description>
  <language>en-us</language>
  <pubDate>02/19/04, 050 37 2004 2004:%i:1077179852 03:37:32</pubDate>
  <lastBuildDate>06/07/13, 158 07 2013 2013:%i:1370578051 00:07:31</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>NineLabs Framework Feed Generator</generator>
  <managingEditor>sitemaster@wpdfd.com</managingEditor>
  <webMaster>sitemaster@wpdfd.com</webMaster>
     <item>
    <title>Crumpet  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p442</link>
    <description><![CDATA[Hi,<br /><br />This is my first post here, and I have a question about coding a Javascript slideshow. &nbsp;First though, a little history -- I am entirely self taught with web design... basically, I've learnt things by doing them. &nbsp;I started out with basic HTML and recently decided to redesign my site and add some more &quot;technical&quot; aspects. &nbsp;The tutorials on this site have been really helpful, and I now have a decent understanding of layers, CSS, etc.. &nbsp;On my site, I decided I wanted to have something that worked like a frame, yet wasn't a frame. &nbsp;I found <a href="http://www.wpdfd.com/editorial/wpd0103.htm#feature">this</a> tutorial and have executed it on one page of my site so far, but have a question.<br /><br />This is the page I've done -- http://www.crumpart.net/test2/artprints.htm -- none of the links at the top of the page will work yet, as it's the only one I've uploaded. &nbsp;Clicking on the thumbnails to the left should work though -- the full image and description appears in the space next to the thumbnails.<br /><br />My problem is with this bit of code that was listed in the tutorial:<br /><br />************************************************<br /><br /> &nbsp; &nbsp; &nbsp;// slide 6 is a special case with timed bullets<br /> &nbsp; &nbsp; &nbsp; &nbsp;// so we call the bullets() function<br /> &nbsp; &nbsp; &nbsp; &nbsp;// to display them sequentially<br /> &nbsp; &nbsp; &nbsp; &nbsp;if(n==6) <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bullets(true);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bullets(false);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp;else // its an old browsers<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp;return false;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp;}<br /> &nbsp; &nbsp;<br /><br />// if t is true, a delay is introduced between<br />// each visible bullet point <br />// if false, there is no delaty and the bullets are hidden &nbsp;<br />function bullets(t) // runs through lines 1 to max<br /> &nbsp; &nbsp;{<br /> &nbsp; &nbsp;index=1;<br /> &nbsp; &nbsp;s=t;<br /> &nbsp; &nbsp;if(t)<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp;delay=secs*1000;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp;delay=0;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp;for (i=0;i&lt;=max;i++)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;time=setTimeout('showit(s)',delay*i);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;clearTimeout(time);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; }<br /><br />************************************************<br /><br />It seems to me that it is about the bullet points, which are not relevant to my site, but when I delete this bit of code, the script stops working for me. &nbsp;As I said, I'm very, very new to Javascript, so if I'm doing something obviously dumb, please forgive me! &nbsp;Help/an explanation would be very much appreciated. &nbsp;Thanks.<br />]]></description>
    <pubDate>02/19/04, 050 37 2004 2004:%i:1077179852 03:37:32</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p442</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p443</link>
    <description><![CDATA[You have the right idea about removing the bullet-specific code except that you removed too much. Just remove this section...<br /><br /><br /> &nbsp; &nbsp; &nbsp; &nbsp;// slide 6 is a special case with timed bullets<br /> &nbsp; &nbsp; &nbsp; &nbsp;// so we call the bullets() function<br /> &nbsp; &nbsp; &nbsp; &nbsp;// to display them sequentially<br /> &nbsp; &nbsp; &nbsp; &nbsp;if(n==6) <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bullets(true);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bullets(false);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /><br />but leave...<br /><br /> }<br /> &nbsp; &nbsp;else // its an old browsers<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp;return false;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp;}<br /><br />See if that fixes your problems. By the way, if you are debugging JavaScript, you really should (if you haven't already) get hold of Mozilla, the JavaScript debugger in Mozilla can help pinpoint such problems.<br /><br />And you can delete the bullets() function as it is no longer called.<br /><br />// if t is true, a delay is introduced between<br />// each visible bullet point <br />// if false, there is no delaty and the bullets are hidden &nbsp;<br />function bullets(t) // runs through lines 1 to max<br /> &nbsp; &nbsp;{<br /> &nbsp; &nbsp;index=1;<br /> &nbsp; &nbsp;s=t;<br /> &nbsp; &nbsp;if(t)<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp;delay=secs*1000;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp;delay=0;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp;for (i=0;i&lt;=max;i++)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;time=setTimeout('showit(s)',delay*i);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;clearTimeout(time);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; }]]></description>
    <pubDate>02/19/04, 050 19 2004 2004:%i:1077182347 04:19:07</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p443</guid>
   </item>
     <item>
    <title>Crumpet  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p444</link>
    <description><![CDATA[Thanks -- that's awesome. &nbsp;It works perfectly now. <img src="/images/emoticons/smile.png" class="smiley" /> <img src="/images/emoticons/smile.png" class="smiley" /> <img src="/images/emoticons/smile.png" class="smiley" /><br /><br />Thanks also for the tip about the Mozilla debugger. &nbsp;I have Mozilla already (I use Safari for browsing generally, but have a whole range of browsers for checking my site) and will give it a go next time I have a problem. <img src="/images/emoticons/smile.png" class="smiley" />]]></description>
    <pubDate>02/19/04, 050 35 2004 2004:%i:1077183359 04:35:59</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p444</guid>
   </item>
     <item>
    <title>Crumpet  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p445</link>
    <description><![CDATA[One more thing...<br /><br />Is there a way to stop all the slide images preloading with my thumbnails, instead having the corressponding image load up when someone clicks on a particular thumbnail? &nbsp;I've just put my &quot;finished&quot; site up at http://www.crumpart.net and, where I've asked for advice, some people have said that some pages take too long to load, and I've discovered that this is the issue. &nbsp;If you go through to the art/photo/shop links, you should see what I mean.<br /><br />Advice would be greatly appreciated!]]></description>
    <pubDate>03/08/04, 068 12 2004 2004:%i:1078780324 16:12:04</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p445</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p446</link>
    <description><![CDATA[I does take rather a long time to load. You could improve the perceived speed by NOT preloading all the larger images.<br /><br />This <a href="http://www.wpdfd.com/wpdslid2.htm">http://www.wpdfd.com/wpdslid2.htm</a> shows you how to load up pictures in the background while the reader is looking at the previous one. It means that the slideshow has to be sequential and not random acesss, but it's a lot faster. You would have to dispense with the thumbnails to stop random order access.]]></description>
    <pubDate>03/09/04, 069 44 2004 2004:%i:1078814658 01:44:18</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p446</guid>
   </item>
     <item>
    <title>Crumpet  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p447</link>
    <description><![CDATA[so there's no way to keep the random access??? &nbsp;i really don't want to do it sequentially...<br /><br />or are your first and second sentences separate ideas? (soory, it's morning, and my brain isn't working too clearly!)]]></description>
    <pubDate>03/09/04, 069 03 2004 2004:%i:1078869813 17:03:33</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p447</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p448</link>
    <description><![CDATA[To have random access, all the images have to be preloaded because you don't know which one the reader will choose to view next. With sequential viewing, the script knows which is the next image to preload in the background.<br /><br />If you don't preload the images, there will be a noticable delay between clicking on the thumbnail and the image appearing, but even that is preferable to having to wait for them all to load before you can view the first one.]]></description>
    <pubDate>03/10/04, 070 18 2004 2004:%i:1078903101 02:18:21</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p448</guid>
   </item>
     <item>
    <title>Crumpet  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p449</link>
    <description><![CDATA[yeah -- i don't mind if there's a delay in this instance. &nbsp;at least that way, if somebody just wants to look at one or two things, they don't have to load every single image just to see those couple. &nbsp;plus it cuts down on my bandwidth usage.<br /><br />i've tried to make each image a small enough file size so that it loads as quickly as possible without compromising (too much, at least <img src="/images/emoticons/wink.png" class="smiley" /> ) on quality, so people on high speed connections shouldn't notice too much of a difference in loading time, and people on slower connections shouldn't have to wait too long.<br /><br />so, next thing, how would i go about putting a command in to stop all the images preloading? &nbsp;i'm pretty new to all this sort of stuff, so if you could point me in the right direction to a similar example or something, i would greatly appreaciate it!]]></description>
    <pubDate>03/10/04, 070 47 2004 2004:%i:1078955220 16:47:00</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p449</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p450</link>
    <description><![CDATA[With a pure JavaScript solution, you normally put a preloading script on a page to make sure that when somebody rolls over a button, the 'over' state is already cached. With the slide show script you are using, it doesn't work like that, it works by hiding layers. When the page is loaded, it loads all the images, even the hidden ones. When somebody want to see one, it is made visible instantly.<br /><br />Here's another little trick that loads on demand, I'll leave it to you to sort out the niceties...<br /><code>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;<br /><br />&lt;html&gt;<br /><br /> &nbsp; &nbsp; &nbsp;&lt;head&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html;charset=iso-8859-1&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;title&gt;Untitled Page&lt;/title&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;script type=&quot;text/javascript&quot;&gt;<br /> &nbsp; &nbsp; &nbsp;function getpic(p)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(document.getElementById)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var f = document.getElementById(&quot;canvas&quot<img src="/images/emoticons/wink.png" class="smiley" />;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;f.style.background=&quot;url(&quot;+p+&quot;<img src="/images/emoticons/wink.png" class="smiley" />&quot;;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/script&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;&lt;!--<br />#canvas &nbsp;{ background-color: #eee; background-image: url(imgs/cryslertop.jpg); visibility: visible; position: absolute; top: 86px; left: 18px; width: 287px; height: 189px }<br />--&gt;&lt;/style&gt;<br /><br /> &nbsp; &nbsp; &nbsp;&lt;/head&gt;<br /><br /> &nbsp; &nbsp; &nbsp;&lt;body bgcolor=&quot;#ffffff&quot;&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;&lt;a href=&quot;javascript:getpic('imgs/cryslertop.jpg')&quot;&gt;Pic 1&lt;/a&gt; &lt;a href=&quot;javascript:getpic('imgs/amsterdam.jpg')&quot;&gt;Pic 2&lt;/a&gt; &lt;a href=&quot;javascript:getpic('imgs/nightarch.jpg')&quot;&gt;Pic 3&lt;/a&gt;&lt;/p&gt;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;div id=&quot;canvas&quot;&gt;&lt;/div&gt;<br /> &nbsp; &nbsp; &nbsp;&lt;/body&gt;<br /><br />&lt;/html&gt;</code>]]></description>
    <pubDate>03/11/04, 071 29 2004 2004:%i:1078982994 00:29:54</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p450</guid>
   </item>
     <item>
    <title>Jdenny  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p451</link>
    <description><![CDATA[you cold have random access - the computer picks the random image and not the user - just pick one image in advance!<br /><br />...user clicks 'next', computer displays pre-loaded image, computer picks another image at random and preloads it (for next time the user clicks 'next')... ]]></description>
    <pubDate>03/13/04, 073 41 2004 2004:%i:1079221278 18:41:18</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p451</guid>
   </item>
     <item>
    <title>Sam Desouza said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p3089</link>
    <description><![CDATA[Hi..thanks for the information… loved it simply Oh man! What an amazing thing to say<br />
<a href="http://www.webteameu.com">web design London</a>]]></description>
    <pubDate>10/28/09, 301 29 2009 2009:%i:1256736544 09:29:04</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_slideshow/#p3089</guid>
   </item>
   </channel>
</rss