[ PHPXref.com ] [ Generated: Sun Jul 20 20:25:35 2008 ] [ SPGM 1.4.4 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> spgm.js (source)

   1  // -- This is a modified version of the original script 
   2  // -- from CodeLifter.com, in order to fit in SPGM
   3  
   4  // SlideShow with Captions and Cross-Fade
   5  // (C) 2002 www.CodeLifter.com
   6  // http://www.codelifter.com
   7  // Free for all users, but leave in this header.
   8  
   9  // ==============================
  10  // Set the following variables...
  11  // ==============================
  12  
  13  // Set the slideshow speed (in milliseconds)
  14  var SlideShowSpeed = 3000;
  15  
  16  // Set the duration of crossfade (in seconds)
  17  var CrossFadeDuration = 3;
  18  
  19  
  20  var tss;
  21  var jss = 1;
  22  var iss = 1;
  23  
  24  var preLoad = new Array();
  25  var arrCaptions = new Array();
  26  var arrWidth = new Array();
  27  var arrHeight = new Array();
  28  
  29  function runSlideShow() {
  30  
  31    if ( document.getElementById('picture') ) {
  32      if (document.all && !window.opera){
  33        document.getElementById('picture').style.filter="blendTrans(duration=2)";
  34        document.getElementById('picture').style.filter="blendTrans(duration=CrossFadeDuration)";
  35        document.getElementById('picture').filters.blendTrans.Apply();
  36      }
  37      document.getElementById('picture').setAttribute('width', arrWidth[jss]);
  38      document.getElementById('picture').setAttribute('height', arrHeight[jss]);
  39      document.getElementById('picture').src = preLoad[jss].src;
  40      if (document.all && !window.opera){
  41        document.getElementById('picture').filters.blendTrans.Play();
  42      }
  43      if ( document.getElementById('picture-caption') ) {
  44        document.getElementById('picture-caption').innerHTML = arrCaptions[jss];
  45      }
  46    }
  47  
  48    jss = jss + 1;
  49    if (jss > (iss - 1)) jss=1;
  50    tss = setTimeout('runSlideShow()', SlideShowSpeed);
  51  }
  52  
  53  function addPicture(pictureURL, caption, width, height) {
  54    preLoad[iss] = new Image();
  55    preLoad[iss].src = pictureURL;
  56    arrCaptions[iss] = caption;
  57    arrWidth[iss] = width;
  58    arrHeight[iss] = height;
  59    iss = iss + 1;
  60  }
  61  
  62  function popupPicture(pictureURL, width, height, justPicture) {
  63    if (justPicture) {
  64      var frame = window.open('', '', 'width='+width+',height='+height+',scrollbars=0,location=0,menubar=0,resizable=1');
  65      frame.document.write(
  66        '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '
  67        +'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n'
  68        +'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n'
  69        +'  <head>\n'
  70        +'    <title>SPGM: '+pictureURL+'</title>'
  71        +'    <style type="text/css">body {margin: 0px}</style>\n'
  72        +'    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n'
  73        +'  </head>\n'
  74        +'  <body>\n'
  75        +'    <div style="margin: 0px;">\n'
  76        +'      <img src="'+pictureURL+'" alt="'+pictureURL+'" />\n'
  77        +'    </div>\n'
  78        +'  </body>\n'
  79        +'</html>'
  80      );
  81      return true;
  82    } else {
  83      window.open(pictureURL, '', 'width='+width+',height='+height+',scrollbars=1,location=0,menubar=0,resizable=1');
  84    }
  85  }
  86  


[ Powered by PHPXref - Served by Debian GNU/Linux ]