Activity Stream
48,167 MEMBERS
6301 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Banned
    Website's:
    Khambaty.com iMotivate.net

    Smile 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 :

    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>
    I hope some one cud help me
    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

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    This is not HTML...

    I can't help you with JS

    Defendos BETA3 Released! Thread - Official Website

  4.     
    #3
    Banned
    Website's:
    Khambaty.com iMotivate.net
    Ooops , Sorry - Need to change the title

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. need small rdp
    By Black Tiger in forum Other Hosting Offers
    Replies: 2
    Last Post: 19th Sep 2012, 02:47 PM
  2. [WordPress] Need a small code edit
    By lukey372 in forum Web Application/Script Support
    Replies: 1
    Last Post: 16th Dec 2011, 01:10 PM
  3. Small PHP help
    By Siruthuli in forum Server Management
    Replies: 2
    Last Post: 8th Oct 2011, 11:00 AM
  4. Looking for php+mysql coder - paying well for small code
    By vps9Ryan in forum Web Development Area
    Replies: 3
    Last Post: 7th Aug 2011, 05:42 PM
  5. [need] a small gfx job done
    By SᴩiDᴇЯ in forum Graphics Area
    Replies: 1
    Last Post: 23rd Mar 2011, 05:52 AM

Tags for this Thread

BE SOCIAL