<code>
<script>
//爆裂代码
var x_step=new Array();
var y_step=new Array();
var x_randompos=new Array();
var y_randompos=new Array();
var x_startpos=0;
var y_startpos=0;
var x_slices=8;
var y_slices=3;
var width_slice=0;
var height_slice=0;
var spancounter=0;
var pause=10;
var max_loop=20;
var i_loop=0;
function explode_init(f)
{
spancounter=0;
if (f.all) {
for (i=0;i<=y_slices-1;i++) {
for (ii=0;ii<=x_slices-1;ii++) {
f.write("<span id='span"+spancounter+"' style='POSITION: absolute;display: ;'></span>");
spancounter++
}
}
spancounter=0;
}
}
function explode_start(obj)
{
var f=wog_view.document;
var img = f.getElementById(obj);//eval("parent.wog_view.document."+obj);
width_slice=Math.floor(img.width/x_slices);
height_slice=Math.floor(img.height/y_slices);
if(img.style.left.search("%")==-1)
{
x_startpos = img.style.posLeft;
}
else
{
x_startpos = (f.body.offsetWidth-20) * (img.style.posLeft)/100;
}
if(img.style.top.search("%")==-1)
{
y_startpos = img.style.posTop;
}
else
{
y_startpos = (f.body.offsetHeight - 5) * img.style.posTop/100;
}
cliptop=0;
clipbottom=height_slice;
clipleft=0;
clipright=width_slice;
i_loop=0;
spancounter=0;
for (i=0;i<=y_slices-1;i++) {
for (ii=0;ii<=x_slices-1;ii++) {
x_randompos[spancounter] = Math.ceil(f.body.offsetWidth*Math.random());
y_randompos[spancounter] = Math.ceil(f.body.offsetHeight*Math.random());
var thisinnerspan=f.getElementById("span"+spancounter);
thisinnerspan.innerHTML="<img id='spimg"+spancounter+"' src='"+img.src+"' style='FILTER: alpha(opacity=100);'>"
thisinnerspan.style.posLeft = x_startpos;
thisinnerspan.style.posTop = y_startpos;
thisinnerspan.style.clip = "rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")";
clipleft+=width_slice;
clipright+=width_slice;
spancounter++;
}
clipleft=0
clipright=width_slice
cliptop+=height_slice
clipbottom+=height_slice
}
spancounter=0;
img.style.display = "none";
explode_IE(f);
}
function explode_IE(f) {
spancounter=0;
for (i=0;i<=y_slices-1;i++) {
for (ii=0;ii<=x_slices-1;ii++) {
try{
var thisspan=f.getElementById("span"+spancounter).style;
x_step[spancounter]=(x_randompos[spancounter]-thisspan.posLeft)/(max_loop);
y_step[spancounter]=(y_randompos[spancounter]-thisspan.posTop)/(max_loop);
thisspan.posLeft+=x_step[spancounter];
thisspan.posTop+=y_step[spancounter];
var eimg = f.getElementById("spimg"+spancounter);
eimg.filters.alpha.opacity = (eimg.filters.alpha.opacity-100/(max_loop));
spancounter++;
if(max_loop==i_loop) thisspan.display = "none";
}catch(e){}
}
}
i_loop++;
spancounter=0;
if(max_loop>=i_loop) var timer=setTimeout("explode_IE(parent.wog_view.document)",pause);
}
//爆裂代码结束
</script>
<form id="wog_view">
<img id="img" src="http://bbs.bc-cn.net/aaa/logo.gif">
</form>
<script>
explode_init(wog_view.document);
explode_start("img");
</script>
</code>