www.webdeveloper.com
Results 1 to 5 of 5

Thread: Two scripts on same page wont work, why?

Hybrid View

  1. #1
    Join Date
    Feb 2014
    Posts
    4

    Two scripts on same page wont work, why?

    Hi to everyone.
    I'm having problem with two scripts that I would like to put on my page.
    One is related to mouse effects and another is animation.
    First one is TINKERBELL MOUSE EFFECT ( http://www.mf2fm.com/rv/dhtmltinkerbell.php ) and it is simulate sparkles when i move mouse over website.
    Second is Flying Butterfly script ( http://www.dynamicdrive.com/dynamicindex4/butterfly.htm )and it shows butterfly picture that fly over a site.

    I put code of the first script to head on my webpage, and code of the second script on the body of my page. Here's the result:
    http://www.livnica.com/proba/PROBNI.html

    When I run my page it shows only butterfly, don't show sparkles.

    Can someone help me please and answer me how to make these two scripts run simultaneously?

    Thank you

  2. #2
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,675
    in the sparkel code remove the line on red

    Code:
    if (NS4||NS6||IE4){
    //window.onload=init;
    window.onresize=function(){ wind_w=getwindowwidth(); wind_h=getwindowheight(); }
    }
    in the butterfly code sdd the line in red

    Code:
    window.onload=function() { if (document.getElementById) {
      var i, rats, rlef, rdow;
      for (var i=0; i<sparkles; i++) {
        var rats=createDiv(3, 3);
        rats.style.visibility="hidden";
        rats.style.zIndex="999";
        document.body.appendChild(tiny[i]=rats);
        starv[i]=0;
        tinyv[i]=0;
        var rats=createDiv(5, 5);
        rats.style.backgroundColor="transparent";
        rats.style.visibility="hidden";
        rats.style.zIndex="999";
        var rlef=createDiv(1, 5);
        var rdow=createDiv(5, 1);
        rats.appendChild(rlef);
        rats.appendChild(rdow);
        rlef.style.top="2px";
        rlef.style.left="0px";
        rdow.style.top="0px";
        rdow.style.left="2px";
        document.body.appendChild(star[i]=rats);
      }
      set_width();
      sparkle();
      init();
    }}
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Feb 2014
    Posts
    4
    Don't work

  4. #4
    Join Date
    Feb 2014
    Posts
    4
    I am new to this and i just trying to combine something for make page nice.
    When I do this as you witted it just shows page without any of two scripts.
    Don't working

  5. #5
    Join Date
    Feb 2014
    Posts
    4
    Sorry. Works perfectly. Found the problem with writting

    Thank you

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles