Skip to main content
Email Password   helpLost your password?

Slideshow

Introduction

This slideshow is to create a professional look like a Flash slideshow. You need not install the Flash player or add-ons to run this slideshow, because it uses simple JavaScript code.

Background

This slideshow has the following prerequisites:

  1. \Images folder [contains images defined in details.xml].
  2. settings.xml [all global setting for the slideshow].
  3. details.xml [contains the data for each slide like title, heading, description, navigate URL, image URL etc..].

The XML file has the following details:

Using the code

Here is an excerpt of the JavaScript code:

//for XML
var xmlDoc,
    xmlDescription;
//for Slide
var slideHeight = "250",
    slideWidth = "450",
    appliedFielter = "blendTrans(duration=1)";
//for Images
var dimages=new Array(),
    arrDesc=new Array();
//for Other
var starterKey,
    currentPage=0;
//for Pagging
var strPaging,
    containerPaging,
    _previousPage=null,
    _currentPage = null,
    totalPages=0,
    Loop=true,
    slideSpeed = 5000,
    pageStyle = "number",
    pagecellpadding = "2px",
    pagecellspacing = "2px",
    pageBackground = "darkgray",
    selectedpageBackground = "red",
    pageFontcolor = "white",
    pageCursor = "pointer",
    pageAlign= "center";
//for description
var descTransparent = 40,
    descLeft = 250,
    descTop = 50,
    descWidth = 290,
    descHeight = 120,
    deschFont = "verdana",
    deschFontColor = "black",
    deschFontSize = "12pt",
    deschFontWeight = "bold",
    descdFont = "verdana",
    descdFontColor = "darkgray",
    descdFontSize = "10pt",
    backgroundIMG = "",
    descdFontWeight = "normal";
var txtPaddingLeft = "4px",
    txtPaddingRight = "4px",
    txtPaddingTop = "4px",
    txtPaddingBottom = "4px";

function getFielter()
{
    appliedFielter = document.getElementById('drpFilter').value;
}
function preload()
{
   //for Slide
   var slide = document.getElementById("imgFilter");
   slide.height = slideHeight;
   slide.width = slideWidth;
   var Description = document.getElementById("divDescription");
   with(Description.style)
   {
       background="url("+ backgroundIMG +")";
       left = descLeft;
       top = descTop;
       width = descWidth;
       height = descHeight;
       filter = "alpha(opacity="+ descTransparent +")";
   }
   var _head = document.getElementById('divsihead');
   with(_head.style)
   {
       fontFamily = deschFont;
       color = deschFontColor; 
       fontSize =  deschFontSize; 
       fontWeight = deschFontWeight; 
   }
   var _desc = document.getElementById('divsidesc');
   with(_desc.style)
   {
       fontFamily = descdFont; 
       color = descdFontColor; 
       fontSize =  descdFontSize; 
       fontWeight = descdFontWeight; 
   }
   var _tblDescription = document.getElementById('tblDescription');
   with(_tblDescription.style)
   {
       paddingTop = txtPaddingTop;
       paddingRight = txtPaddingRight;
       paddingBottom = txtPaddingBottom;
       paddingLeft = txtPaddingLeft;
   }


For the complete source code, please download the file from the top of this article.


"462" alt="Slideshow effects" src="Slideshow/slideshow-effect.gif" width="511" />


"Caption">Sample screenshot of slideshow effect

Conclusion

If this is helpful for you, please give your feedback/rate and review to me. Thanks!
You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralIt does not work in Fire fox Pin
binodthapa
18:57 12 May '09  
AnswerRe: It does not work in Fire fox Pin
Sunasara Imdadhusen
2:47 5 Oct '09  
Generalcan you provide flash show ? Pin
JLKEngine008
19:43 23 Sep '08  
GeneralGreat, but..... Pin
m3jim
14:50 8 Sep '08  
GeneralRe: Great, but..... Pin
Sunasara Imdadhusen
20:20 10 Sep '08  
GeneralRe: Great, but..... Pin
Sunasara Imdadhusen
20:08 26 Oct '08  
GeneralVery Nice !!!! Pin
Abhijit Jana
4:35 5 Sep '08  
GeneralRe: Very Nice !!!! Pin
Sunasara Imdadhusen
20:34 10 Sep '08  
GeneralVery Nice [modified] Pin
JLKEngine008
0:52 5 Sep '08  
GeneralRe: Very Nice Pin
Sunasara Imdadhusen
20:30 10 Sep '08  


Last Updated 4 Sep 2008 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009