PDA

View Full Version : Help with pixelate



MasumX
05-03-2005, 05:03 AM
http://www.dynamicdrive.com/dynamicindex14/pixelate.htm

Can anyone put that pixelate into ".js"? put the javascript code in .js so it would be less "Mess" on the layout! and that is if possible... thanks in advanced! :)!

jscheuer1
05-03-2005, 07:28 AM
<html>
<head>
<title>External Pixelate - Demo</title>
<script src="pix1.js" type="text/javascript">
//Pixelating Image slideshow
//Copyright Dynamic Drive 2001
//Visit http://www.dynamicdrive.com for this script
</script>
</head>
<body>
<script src="pix2.js" type="text/javascript"></script>
<p align="center"><font face="arial" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
</body></html>pix1.js

//specify interval between slide (in mili seconds)
var slidespeed=3000
//specify images
var slideimages=new Array("photo1.jpg","photo2.jpg","photo3.jpg")
//specify corresponding links
var slidelinks=new Array("http://www.dynamicdrive.com","http://wsabstract.com","http://www.geocities.com")
var imageholder=new Array()
var ie55=window.createPopup
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}
function gotoshow(){
window.location=slidelinks[whichlink]
}pix2.js

document.write('<a href="javascript:gotoshow()"><img src="photo1.jpg" name="slide" border=0 style="filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,Duration=1)"></a>')
var whichlink=0
var whichimage=0
var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie55) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie55) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+pixeldelay)
}
slideit()

MasumX
05-03-2005, 08:42 PM
Edit: Thanks it works :)!!