»
Tiếng AnhTiếng PhápTiếng Việt

In - Ảnh vỡ tan từng mảnh - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Hình ảnh » Ảnh vỡ tan từng mảnh
URL: https://www.javascriptbank.com/explosive-image-onclick.html

Ảnh vỡ tan từng mảnh © JavaScriptBank.comHiệu ứng làm cho ảnh tự động vỡ tung thành từng mảnh khi người dùng nhấp chuột vào nó. Bạn có thể thay đổi các thông số về thời gian, số mảnh nổ của ảnh.

Phiên bản đầy đủ: jsB@nk » Hình ảnh » Ảnh vỡ tan từng mảnh
URL: https://www.javascriptbank.com/explosive-image-onclick.html



JavaScript
<script language="JavaScript">var author="www.javascriptbank.com";var image1="logojs.gif";var posx1="100";var posy1="70";var reglink1="";var regtarget1="";var image2="photo3.jpg";var posx2="340";var posy2="80";var reglink2="";var regtarget2="";var image3="photo7.jpg";var posx3="290";var posy3="190";var reglink3="";var regtarget3="";var image4="";var posx4="";var posy4="";var reglink4="";var regtarget4="";var image5="";var posx5="";var posy5="";var reglink5="";var regtarget5="";var image6="";var posx6="";var posy6="";var reglink6="";var regtarget6="";var pause="2";var numxslices="4";var numyslices="4";var intensity="1";var regkey="";var syr=parseInt(pause)*50; var B_a=parseInt(numxslices); var sTO=parseInt(numyslices); var HXb=parseInt(intensity)+1;  var lIJ=new Array(); lIJ[0]=image1; lIJ[1]=image2; lIJ[2]=image3;      lIJ[3]=image4; lIJ[4]=image5; lIJ[5]=image6; lIJ[6]=""; var Rhb=new Array(); var _Sp=new Array(); Rhb[0]=(posx1=="")?-1:parseInt(posx1); _Sp[0]=(posy1=="")?-1:parseInt(posy1); Rhb[1]=(posx2=="")?-1:parseInt(posx2); _Sp[1]=(posy2=="")?-1:parseInt(posy2); Rhb[2]=(posx3=="")?-1:parseInt(posx3); _Sp[2]=(posy3=="")?-1:parseInt(posy3); Rhb[3]=(posx4=="")?-1:parseInt(posx4); _Sp[3]=(posy4=="")?-1:parseInt(posy4); Rhb[4]=(posx5=="")?-1:parseInt(posx5); _Sp[4]=(posy5=="")?-1:parseInt(posy5); Rhb[5]=(posx6=="")?-1:parseInt(posx6); _Sp[5]=(posy6=="")?-1:parseInt(posy6); var CaT=0; var Fs3=0; while(lIJ[CaT++]!="") Fs3++; var v28=new Array(); var jhq=new Array(); var Ngf=new Array(); jhq[0]=(reglink1=="")?"#":reglink1;  jhq[1]=(reglink2=="")?"#":reglink2;  jhq[2]=(reglink3=="")?"#":reglink3;  jhq[3]=(reglink4=="")?"#":reglink4;  jhq[4]=(reglink5=="")?"#":reglink5;  jhq[5]=(reglink6=="")?"#":reglink6;  Ngf[0]=(regtarget1=="")?"_self":regtarget1; Ngf[1]=(regtarget2=="")?"_self":regtarget2; Ngf[2]=(regtarget3=="")?"_self":regtarget3; Ngf[3]=(regtarget4=="")?"_self":regtarget4; Ngf[4]=(regtarget5=="")?"_self":regtarget5; Ngf[5]=(regtarget6=="")?"_self":regtarget6; var q36=0; var oPi=0; var UFu=0; for(CaT=0;CaT<Fs3;CaT++){ v28[CaT]=new Image(); v28[CaT].src=lIJ[CaT]; } var pLu=regkey; var rFS=new Array(); var k7s=new Array(); var X8Y=new Array(); var T5i=new Array(); var umr; var Ks5; var sliceW; var sliceH; var cliptop; var clipbottom; var clipleft; var clipright; var qJF=0; var b8a; if(author!="www.javascriptbank.com")alert("Please don't remove\r\nvar author=\"www.javascriptbank.com\";"); var OMa; var nCc; var KY1; var nTV; var _Wd; var gaB; var KNL; var Ot1; var _kz; var qHM; var MFj; var tsZ=150; var CGf=tsZ+8; var CIZ=1; var RAQ=0; var CaT=0; var nvR=(document.layers)?1:0;  var XrO=(document.all)?1:0;  var fMq=(document.getElementById&&!document.all);  var AgB=(XrO)?window.document.body.clientWidth:window.innerWidth;  var MHd=(XrO)?window.document.body.clientHeight:window.innerHeight;  var uUA=(XrO)?window.document.body.scrollLeft:window.pageXOffset;  var KUP=(XrO)?window.document.body.scrollTop:window.pageYOffset;  var YyF="k66b"; var LQb=YyF.split(""); var vyW="c5-a"; var UBJ=vyW.split(""); var bqd=":/"+"/"; var D__="r-crrc"; var yDw=D__.split(""); var vCW=RAQ; var u2K="eeesf23hh3r62sray"; var _B2=u2K.split(""); var S5f="r5-b6"; var YG4=S5f.split(""); var OG6="v7"; var JYD="9fg7hjklz6xc.v8bn1m0"; var Cyy=OG6.split(""); var Rfu="q2se4rtyu3i5opa-wd"+JYD; var OpQ=Rfu.split(""); var lES=""; var DB4="ible"; var NMn="abcdefghijklmnopqrstuvwxyz"; var Qho="ank"; var tFa=pLu.length; var W13="0123456789-."; var CgJ=pLu.split(""); var lAo="den"; var oIS=W13+NMn; var Erl=oIS.split(""); var gkq="hid"; var UPY="bl"; var _eN="vis"; var blo=""; var Z8g=location.host; var Fyt=Z8g.toLowerCase(); var a4t=Fyt.split(""); var cyA="ow"; var jpa="e"; var HqG="sh"; for(CaT=0;CaT<5;CaT++) lES+=OpQ[oIS.indexOf(YG4[CaT])];  MFj="S"+lES; lES="";for(CaT=0;CaT<17;CaT++) lES+=OpQ[oIS.indexOf(_B2[CaT])];  gaB=lES;_kz="_"+UPY+Qho; lES=" ";for(CaT=0;CaT<2;CaT++) lES+=OpQ[oIS.indexOf(Cyy[CaT])];  MFj+=lES; lES=" D"; for(CaT=0;CaT<4;CaT++) lES+=OpQ[oIS.indexOf(UBJ[CaT])];  MFj+=lES; lES=" S"; for(CaT=0;CaT<6;CaT++) lES+=OpQ[oIS.indexOf(yDw[CaT])];  MFj+=lES; lES="";for(CaT=0;CaT<4;CaT++) lES+=OpQ[oIS.indexOf(LQb[CaT])];  KNL=lES;lES=""; for(CaT=2;CaT<tFa-2;CaT++) lES+=OpQ[oIS.indexOf(CgJ[CaT])];  if(a4t.length>4) if(a4t[0]!="w"&&a4t[3]!="."&&a4t[2]!="w"&&a4t[1]!="w") blo="www."+Z8g; else blo=Z8g; Ot1=KNL+bqd+gaB; OMa=HqG+cyA; nCc=gkq+lAo; if(blo==lES)vCW=CIZ; if(OpQ[tFa>>1]!=CgJ[0]||OpQ[tFa]!=CgJ[1]||OpQ[tFa]!=CgJ[tFa-2] ||OpQ[tFa>>2]!=CgJ[tFa-1]) vCW=RAQ;KY1=gkq+jpa; nTV=_eN+DB4; document.write("<style>td.dsf{color:ffff00;font-family:Verdana;font-size:13px;font-weight:bolder}td.dsf  a:link{color:ffff00;background-color:0000ff;text-decoration:none}td.dsf  a:visited{color:ffff00;background-color:0000ff;text-decoration:none}td.dsf  a:hover{color:ffffff;background-color:0000ff;text-decoration:none}</style><div  id=\"dsC\"  style=\"position:absolute;top:0px;left:0px;width:0px;height:0px;visibility:hide;visibility:hidden;z-Index:1000;\" align=\"center\"><table  border=\"1\"  bordercolor=\"#000000\"  cellpadding=\"1\"  cellspacing=\"0\"  bgcolor=\"#0000ff\"><td  class=\"dsf\"  align=\"center\"><a  href=\""+Ot1+"\" target=\""+_kz+"\">"+gaB+"</a></td></table></div>");  function _4q(){ window.status =MFj; return true; }if(gaB.charAt(4)!="d") vCW=RAQ; function D3s(){ window.status =""; return true; } function _K1(){; if(vCW==RAQ){ if(nvR){qHM=document.dsC;  qHM.visibility=KY1; qHM.top=(KUP+8); qHM.left=(AgB+uUA-CGf); qHM.visibility=OMa; qHM.onmouseover=_4q; qHM.onmouseout=D3s; } else if(fMq){ qHM=document.getElementById("dsC");  qHM.style.top=KUP+8; qHM.style.left=(AgB+uUA-CGf-8); qHM.style.visibility=nTV; qHM.onmouseover=_4q; qHM.onmouseout=D3s; } else if(XrO){ qHM=document.all.dsC;  qHM.style.top=KUP+8; qHM.style.left=(AgB+uUA-CGf); qHM.style.visibility=nTV; qHM.onmouseover=_4q; qHM.onmouseout=D3s; }}}for(CaT=0;CaT<Fs3;CaT++){ if(vCW==RAQ){ jhq[CaT]=Ot1; Ngf[CaT]=_kz; }}if(nvR){ for(CaT=0;CaT<Fs3;CaT++){ document.write("<layer name=\"sn"+CaT+"\" visibility=\"hide\"><a href=\""+jhq[CaT]+"\" target=\""+Ngf[CaT]+"\"><img src=\""+lIJ[CaT]+"\" border=\"0\"></a></layer>");  }} else if(fMq){ window.document.body.style.overflow="hidden";  for(CaT=0;CaT<Fs3;CaT++){ document.write("<div id=\"sg"+CaT+"\" style=\"position:absolute;top:0px;left:0px;visibility:hidden;\"><a href=\""+jhq[CaT]+"\" target=\""+Ngf[CaT]+"\"><img  src=\""+lIJ[CaT]+"\" border=\"0\"></a></div>");  }} else if(XrO){ for(yy=0;yy<sTO;yy++){ for(xx=0;xx<B_a;xx++){ document.write("<div style=\"position:absolute;top:0px;left:0px\">");  document.write("<div style=\"position:relative\">");  document.write("<div id=\"si\" style=\"position:absolute;top:0px;left:0px;visibility:hidden;\"></div>");  document.write("</div>");  document.write("</div>");  }}} var SnR,fVa; var vrn,b2z; var X8Y=new Array(); var T5i=new Array(); var MqI=new Array(); var NLZ=new Array(); var YvK=0.1; var JXj=B_a*sTO; b2z=0;vrn=(Math.random()-0.5)*4;  var YBU=new Array(); function rlU(){ AgB=(XrO)?window.document.body.clientWidth:window.innerWidth;  MHd=(XrO)?window.document.body.clientHeight:window.innerHeight;  uUA=(XrO)?window.document.body.scrollLeft:window.pageXOffset;  KUP=(XrO)?window.document.body.scrollTop:window.pageYOffset;  for(CaT=0;CaT<B_a*sTO;CaT++){ si[CaT].innerHTML="<a href=\""+jhq[UFu]+"\" target=\""+Ngf[UFu]+"\"><img  src=\""+lIJ[UFu]+"\" border=\"0\"></a>";  }umr=si[0].offsetWidth; Ks5=si[0].offsetHeight; sliceW=Math.floor(umr/B_a); sliceH=Math.floor(Ks5/sTO); b8a=0;cliptop=0; clipbottom=sliceH; clipleft=0; clipright=sliceW; for(yy=0;yy<sTO;yy++){ for(xx=0;xx<B_a;xx++){ si[b8a].style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"; si[b8a].style.visibility="hidden"; clipleft+=sliceW; clipright+=sliceW; YBU[b8a]=1; b8a++;}clipleft=0; clipright=sliceW; cliptop+=sliceH; clipbottom+=sliceH; }b8a=0;if(Rhb[UFu]==-1){ Rhb[UFu]=Math.floor(AgB>>1)-Math.floor(umr>>1); }if(_Sp[UFu]==-1){ _Sp[UFu]=Math.floor(MHd>>1)-Math.floor(Ks5>>1); } var OqC; var xtV,ly,dist; for(CaT=0; CaT<JXj;CaT++){ X8Y[CaT]=Rhb[UFu]; T5i[CaT]=_Sp[UFu]; MqI[CaT]=Math.round((Math.random()-0.5)*(HXb*2));  NLZ[CaT]=Math.round((Math.random()-0.5)*HXb);  dist=Math.round(Math.random()*HXb);  xtV=MqI[CaT]; ly=NLZ[CaT]; OqC=Math.sqrt(xtV*xtV+ly*ly); if(OqC==0.0) OqC=0.0; else  OqC=1.0/OqC; MqI[CaT]*=(OqC*dist); NLZ[CaT]*=(OqC*dist); }} function sRg(){ if(oPi<JXj){ for(CaT=0;CaT<JXj;CaT++){ var P3I=Math.round(X8Y[CaT]); var Gbf=Math.round(T5i[CaT]); if((Gbf<MHd)&&(YBU[CaT]==1)){ si[CaT].style.pixelLeft=P3I+uUA; si[CaT].style.pixelTop=Gbf+KUP; si[CaT].style.visibility="visible"; X8Y[CaT]+=MqI[CaT]; T5i[CaT]+=NLZ[CaT]; NLZ[CaT]+=YvK; } else if(YBU[CaT]==1){ oPi++;si[CaT].style.visibility="hidden"; YBU[CaT]=0; }}} else{  if(qJF==0){UFu=(UFu+1)%Fs3;if(XrO)rlU();} if(XrO){for(CaT=0;CaT<JXj;CaT++){ si[CaT].style.pixelLeft=Rhb[UFu]; si[CaT].style.pixelTop=_Sp[UFu]; si[CaT].style.visibility="visible"; }}if(qJF++>syr){ qJF=0;oPi=0; }}}if(XrO)rlU(); qJF=1;oPi=JXj; function pbw(){ AgB=(XrO)?window.document.body.clientWidth:window.innerWidth;  MHd=(XrO)?window.document.body.clientHeight:window.innerHeight;  uUA=(XrO)?window.document.body.scrollLeft:window.pageXOffset;  KUP=(XrO)?window.document.body.scrollTop:window.pageYOffset;  if(nvR){ document.layers["sn"+UFu].left=Rhb[UFu];  document.layers["sn"+UFu].top=_Sp[UFu];  document.layers["sn"+UFu].visibility="show";  } else if(fMq){ document.getElementById("sg"+UFu).style.left=Rhb[UFu];  document.getElementById("sg"+UFu).style.top=_Sp[UFu];  document.getElementById("sg"+UFu).style.visibility="visible";  }if(XrO)sRg(); _K1();} function akF(){ pbw();setTimeout("akF()",20); }window.onload=akF;  window.onresize = new Function("window.location.reload()"); </script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->