Save 25% on Wizard’s SQL for WP w/ code: WIZARDSQL
Web Dev + WordPress + Security

Slideshow Code for Dead Letter Art

[ Icon: DLa Joker ] Pardon this post! I am posting this information online for personal references purposes. I may need to revisit this code at some point in the future, and if I post it here I will always know where to find it (trust me, it would disappear into the abyss if I tried storing it offline). So, although it is intended solely for myself, feel free to extract and use anything you like, as long as commented attribution remains. What we have here are two different methods for including a slideshow on a web page. The first method employs the techniques discussed in this article, while the second method skips the Flash and employs only the JavaScript portion of the slideshow. Here is some additional help with embedding Flash content, including slideshows, and JavaScript techniques.

Main Slideshow

<?php // main slideshow // ?>
<div class="midright">
<!-- slideshow inclusion by perishablepress.com -->
<script type="text/javascript">
<!--//--><![CDATA[//><!-- 
if (flash.ver[7]) {
   document.write(
      '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="300" height="225" id="slideshow" align="middle">' +
      '<param name="movie" value="http://deadletterart.com/dla/images/slideshow/slideshow.swf" />' +
      '<param name="allowScriptAccess" value="sameDomain" />' +
      '<param name="quality" value="high" />' +
      '<param name="bgcolor" value="#000" />' +
      '<param name="base" value="." />' +
      '<embed src="http://deadletterart.com/dla/images/slideshow/slideshow.swf" base="." quality="high" bgcolor="#000" width="300" height="225" name="slideshow" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
      '<\/object>'
   );
}
else if (flash.installed) {
   document.write('<form id="slideshow" name="slideshow" action="null"><a href="#" onmouseover="this.href=theimage[i][1];return false">');
   document.write('<img name="imgslide" class="y" id="imgslide" src="' + theimage[0][0] + '" border="0" alt="DLa Slideshow" />');
   document.write('<\/a><\/form>');
} else {
   document.write('<form id="slideshow" name="slideshow" action="null"><a href="#" onmouseover="this.href=theimage[i][1];return false">');
   document.write('<img name="imgslide" class="y" id="imgslide" src="' + theimage[0][0] + '" border="0" alt="DLa Slideshow" />');
   document.write('<\/a><\/form>');
}
//--><!]]>
</script>
<noscript><div><img src="http://deadletterart.com/dla/images/slideshow/1.jpg" class="y" alt="Serious Business" /></div></noscript>
</div>

Alternate Slideshow

<?php // alt slideshow // ?>
<div class="midright">
 <!-- slideshow inclusion by perishablepress.com -->
 <form id="slideshow" name="slideshow" action="null">
  <div>
   <a href="#" onmouseover="this.href=theimage[i][1];return false">
    <script type="text/javascript">
     <!--//--><![CDATA[//><!--
      document.write('<img name="imgslide" class="y" id="imgslide" src="'+theimage[0][0]+'" border="0" alt="DLa Slideshow" />');
     //--><!]]>
    </script>
   </a>
  </div>
  <noscript>
   <p><img src="http://deadletterart.com/dla/images/slideshow/1.jpg" class="y" alt="Serious Business" /></p>
  </noscript>
 </form>
</div>

More sweet code snippets on the way..

Jeff Starr
About the Author
Jeff Starr = Web Developer. Book Author. Secretly Important.
BBQ Pro: The fastest firewall to protect your WordPress.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
BBQ Pro: The fastest firewall to protect your WordPress.
Thoughts
Plugin updates! All of our free and pro plugins ready for WordPress 6.2.
Daylight savings is a complete waste of time and needs to be eliminated.
Got a couple of snow days here in mid-March. Fortunately it's not sticking.
I handle all email in real time as it comes in, perpetually clear inbox for years now.
Added some nice features to Wutsearch search engine launchpad. Now 21 engines!
.wp TLD plz :)
Nice collection of free SEO APIs and user-agent lookups for Googlebot, Bingbot, Applebot, YandexBot, and more.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.