بدون شرح
کد زیر را در قسمت ویراش htmlکپی کنید.
<!-- configurable script --> <script type="text/javascript"> theimage = new Array();
// The dimensions of ALL the images should be the same or some of them may look stretched or reduced in Netscape 4. // Format: theimage[...]=[image URL, link URL, name/description] theimage[0]=["http://rozanehonline.com/rozanehgroup/dey91/no-comment/05.jpg", "jalebmag.rozblog.com", "بدون شرح"]; theimage[1]=["http://rozanehonline.com/rozanehgroup/dey91/no-comment/06.jpg", "jalebmag.rozblog.com", "بدون شرح"]; theimage[2]=["http://rozanehonline.com/rozanehgroup/dey91/no-comment/07.jpg", "jalebmag.rozblog.com", "بدون شرح"];
///// Plugin variables
playspeed=5000;// The playspeed determines the delay for the "Play" button in ms playdiffernce=500; // The speed that the autoplay speed is changed by. 1000=1sec
dotrans=1; // if value = 1 then there are transitions played in IE transtype='revealtrans';// 'blendTrans' or 'revealtrans' transattributes='15';// duration=seconds,transition=#<24 //##### //key that holds where in the array currently are i=0;
//########################################### //if random function SetRandom() { tempimage = new Array(); for(p=0; p<theimage.length; p++){ for(p1=0; p1>-1; p1) { tempNum = Math.floor(Math.random()*theimage.length) if(!tempimage[tempNum]){ tempimage[tempNum]=theimage[p]; break; } } } for(p=0;p<theimage.length;p++)theimage[p]=tempimage[p]; }
//if random order SetRandom()
//########################################### window.onload=function(){
//preload images into browser preloadSlide();
//"jump to" box for (y=0;y<theimage.length;y++) { document.slideshow.imgComboBox[y]=new Option(theimage[y][2]); }
//set transitions GetTrans();
//set the first slide SetSlide(0);
//autoplay PlaySlide(); }
//########################################### function SetSlide(num) { //too big i=num%theimage.length; //too small if(i<0)i=theimage.length-1;
//switch the image if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Apply()') document.images.imgslide.src=theimage[i][0]; if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Play()')
//if drop down box if(document.slideshow.imgComboBox){ document.slideshow.imgComboBox.selectedIndex = i; }
//if they want name of current slide document.getElementById('slidebox').innerHTML=theimage[i][2];
//if they want current slide number and total document.getElementById('slidecount').innerHTML= "Image "+(i+1)+" of "+theimage.length;
//if they have the speed timer if(document.slideshow.slidespeed){ SetSpeed(0); }
}
//########################################### function PlaySlide() { if (!window.playing) { PlayingSlide(i+1); if(document.slideshow.play){ document.slideshow.play.value="توقف"; } } else { playing=clearTimeout(playing); if(document.slideshow.play){ document.slideshow.play.value="اجرا"; } } // if you have to change the image for the "playing" slide if(document.images.imgPlay){ setTimeout('document.images.imgPlay.src="'+imgStop+'"',1); imgStop=document.images.imgPlay.src } }
//########################################### function PlayingSlide(num) { playing=setTimeout('PlayingSlide(i+1);SetSlide(i+1);', playspeed); }
//########################################### function SetSpeed(num){ if(playspeed+num>0){ playspeed+=num; document.slideshow.slidespeed.value=playspeed; } }
//########################################### //desc: picks the transition to apply to the images function GetTrans() { //si=document.slideshow.trans.selectedIndex;
if((document.slideshow.trans && document.slideshow.trans.selectedIndex == 0) || (!document.slideshow.trans && dotrans==0)){ dotrans=0; } else if ((document.slideshow.trans && document.slideshow.trans.selectedIndex == 1) || (!document.slideshow.trans && transtype == 'blendTrans')){ dotrans=1; transtype='blendTrans'; document.imgslide.style.filter = "blendTrans(duration=1,transition=1)"; }else{ dotrans=1; transtype='revealtrans'; if(document.slideshow.trans) transattributes=document.slideshow.trans[document.slideshow.trans.selectedIndex].value; document.imgslide.style.filter = "revealTrans(duration=1,transition=" +transattributes+ ")"; }
} //########################################### function preloadSlide() { for(k=0;k<theimage.length;k++) { theimage[k][0]=new Image().src=theimage[k][0]; } }
</script>
<!-- slide show HTML --> <form name="slideshow">
<table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <td align="center"> <a href="#" onmouseover="this.href=theimage[i][1];return false"> <script type="text/javascript"> document.write('<img name="imgslide" id="imgslide" src="'+theimage[0][0]+'" border="0">') </script> </a> </td> </tr> <tr> <td align="center"><div id="slidecount"></div></td> </tr> <tr> <td align="center"><div id="slidebox"></div></td> </tr> <tr> <td align="center"> Effect:<br /> <select name="trans" onchange="GetTrans();"> <option selected>None</option> <option>Blend Transition</option> <option value="0">0 - Box in</option> <option value="1">1 - Box out</option> <option value="2">2 - Circle in</option> <option value="3">3 - Circle out</option> <option value="4">4 - Wipe up</option> <option value="5">5 - Wipe down</option> <option value="6">6 - Wipe right</option> <option value="7">7 - Wipe left</option> <option value="8">8 - Vertical blinds</option> <option value="9">9 - Horizontal blinds</option> <option value="10">10 - Checkerboard across</option> <option value="11">11 - Checkerboard down</option> <option value="12">12 - Random dissolve</option> <option value="13">13 - Split vertical in</option> <option value="14">14 - Split vertical out</option> <option value="15">15 - Split horizontal in</option> <option value="16">16 - Split horizontal out</option> <option value="17">17 - Strips left down</option> <option value="18">18 - Strips left up</option> <option value="19">19 - Strips right down</option> <option value="20">20 - Strips right up</option> <option value="21">21 - Random bars horizontal</option> <option value="22">22 - Random bars vertical</option> <option value="23">23 - Random Apply above filters randomly</option> </select> </td> </tr> <tr> <td align="center"> Autoplay Speed:<br /> <input type="button" value=" /\ " onclick="SetSpeed(playdiffernce)" TITLE="+ Speed" /> <input type="text" name="slidespeed" readonly size="5" onfocus="blur();" /> <input type="button" value=" \/ " onclick="SetSpeed(-playdiffernce)" TITLE="- Speed" /> </td> </tr> <tr> <td align="center"> <select name="imgComboBox" onchange="SetSlide(document.slideshow.imgComboBox.selectedIndex);"></select> </td> </tr> <tr> <td align="center"> <input type="button" style="padding:3px 7px; font-family: tahoma;font-size:11px; font-weight:bold " value="|<<" onclick="SetSlide(0);" title="Jump to starting image"> <input type="button" style="padding:3px 7px; font-family: tahoma;font-size:11px; font-weight:bold" value="<<" onclick="SetSlide(i-1);" title="Previous image"> <input type="button" style="padding:3px 7px; font-family: tahoma;font-size:11px; font-weight:bold" name="play" value="اجرا" onclick="PlaySlide();" title="Autoplay"> <input type="button" style="padding:3px 7px; font-family: tahoma;font-size:11px; font-weight:bold" value=">>" onclick="SetSlide(i+1);" title="Jump to next image"> <input type="button" style="padding:3px 7px; font-family: tahoma;font-size:11px; font-weight:bold" value=">>|" onclick="SetSlide(theimage.length-1);" title="Jump to ending image"> </td> </tr> </table>
</form> <!-- end of slide show HTML --> |