Results 1 to 3 of 3
-
5th Nov 2010, 10:03 AM #1OPBannedWebsite's:
Khambaty.com iMotivate.netNeed Small help with a Small JS code
Hi Coderz , I have a small Code which makes an image float in a gadget , Its actually a COuntdown gadget but when ever I insert this code the image starts Floating before the countdown is over So my Main AIM is to Make this Image float only after the countdown is over and when the image floats the Background should go transparent
Here's The code :
Code:<SCRIPT language=JavaScript> var snowsrc="mubarak.png" var no = 1; var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var nn6up = (document.getElementById) ? 1 : 0; var dx, xp, yp; var am, stx, sty; var i, doc_width = 800, doc_height = 600; if (ns4up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } else if (nn6up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array(); for (i = 0; i < no; ++ i) { dx[i] = 0; xp[i] = Math.random()*(doc_width-50); yp[i] = Math.random()*doc_height; am[i] = Math.random()*20; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); if (ns4up) { if (i == 0) { document.write("<center><layer name=dot"+ i +" left=15 top=15 visibility=show><img src='"+snowsrc+"' border=0></layer></center>"); } else { document.write("<center><layer name=dot"+ i +" left=15 top=15 visibility=show><img src='"+snowsrc+"' border=0></layer></center>"); } } else if (ie4up || nn6up) { if (i == 0) { document.write("<div id=dot"+ i +" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=0></div>"); } else { document.write("<div id=dot"+ i +" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=0></div>"); } } } function snowNS() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } dx[i] += stx[i]; document.layers["dot"+i].top = yp[i]; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNS()", 10); } function snowIE() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } dx[i] += stx[i]; document.all["dot"+i].style.pixelTop = yp[i]; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowIE()", 10); } function snowNN6() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } dx[i] += stx[i]; document.getElementById("dot"+i).style.top = yp[i]; document.getElementById("dot"+i).style.left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNN6()", 10); } if (ns4up) { snowNS(); } else if (ie4up) { snowIE(); } else if (nn6up) { snowNN6(); } </SCRIPT>
Netguy Reviewed by Netguy on . Need Small help with a Small JS code Hi Coderz , I have a small Code which makes an image float in a gadget , Its actually a COuntdown gadget but when ever I insert this code the image starts Floating before the countdown is over So my Main AIM is to Make this Image float only after the countdown is over and when the image floats the Background should go transparent Here's The code : <SCRIPT language=JavaScript> var snowsrc="mubarak.png" var no = 1; var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? Rating: 5
-
5th Nov 2010, 10:04 AM #2MemberWebsite's:
Elite.SO Defendos.com Motionite.comThis is not HTML...
I can't help you with JS
-
5th Nov 2010, 10:08 AM #3OPBannedWebsite's:
Khambaty.com iMotivate.netOoops , Sorry - Need to change the title
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
need small rdp
By Black Tiger in forum Other Hosting OffersReplies: 2Last Post: 19th Sep 2012, 02:47 PM -
[WordPress] Need a small code edit
By lukey372 in forum Web Application/Script SupportReplies: 1Last Post: 16th Dec 2011, 01:10 PM -
Small PHP help
By Siruthuli in forum Server ManagementReplies: 2Last Post: 8th Oct 2011, 11:00 AM -
Looking for php+mysql coder - paying well for small code
By vps9Ryan in forum Web Development AreaReplies: 3Last Post: 7th Aug 2011, 05:42 PM -
[need] a small gfx job done
By SᴩiDᴇЯ in forum Graphics AreaReplies: 1Last Post: 23rd Mar 2011, 05:52 AM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...