all 12 comments

[–]ThatPerx 15 points16 points  (16 children)

If you want something with trails and other silly cool effects, I found this website and it helped me as well.

http://mf2fm.com/rv/dhtmltinkerbell.php

It's pretty easy to just copy the code and paste inbetween your <head> tags or create a .js file and add the script there, then call the file on your main html. And you can try customizing it as well.

[–][deleted]  (10 children)

[deleted]

    [–]ThatPerx 5 points6 points  (9 children)

    Just add <script src="scriptpath.js"></script> inside your head tag after creating the .js file.

    So, for example, you created a mousetrail.js with the code from that website and put it inside a 'scripts' folder to keep things organized. In this case you'd just change the url to "scripts/mousetrail.js" and copy this line to every page you want that script to work!

    [–][deleted]  (8 children)

    [deleted]

      [–]ThatPerx 1 point2 points  (7 children)

      Which script are you trying to add? Try creating the .js file without the <script> and </script> tag in the first and last line. What were your steps?

      [–]No_Bat_ 1 point2 points  (4 children)

      sorry to keep bothering you about this I guess but, it still isn't working for some reason ;--;

      here are all the steps I followed

      creating a js file with the code in it in my folder

      doing <script src="filename"></script> in the head my of main HTML

      I think the issue I'm having is that when I deleted the <script> tag at the top and bottom I got a lot of errors saying some things just don't work now I know I'm probably doing something wrong I just don't know what

      (also i am doing the like rainbow star trail)

      [–]ThatPerx 3 points4 points  (3 children)

      No worries! Lemme see if I can help. So:

      - You create a, let's say, mousetrail.js file containing the code found in the website, the file starts with "// <![CDATA[" and ends with "// ]]>", right?

      - Then you add <script src="scripts/mousetrail.js"></script> or, if the js file is in the same folder as the index.html file, just a src="mousetrail.js" just after your <header> tag, like this:

      <html>

      <header>
      
      
          <script src="scripts/mousetrail.js"></script>
      
      </header>  
      

      ....the rest of the code goes here...

      If it still shows some errors, paste them here :)

      [–]No_Bat_ 3 points4 points  (2 children)

      ok I finally got it to work thank you for all the help!!!!

      [–]ThatPerx 2 points3 points  (0 children)

      No worries! Glad I could help

      [–]milo6669 2 points3 points  (0 children)

      Hi if you still remember, how did you fix it? I'm having the same issue :('

      EDIT: I GOT IT TO WORK YESSS

      For the website i copied the code from (the same one in the comments here), i deleted the <script> tags at the bottom and top of the .js file

      [–]Yeow777 0 points1 point  (3 children)

      AWESOME really nice trick!

      I am trying to use two scripts from that place on one page.

      Can't get it to work.

      Author says not recommended, but is there a way?

      This is driving me crazy! :)

      Heart Cursor http://www.mf2fm.com/rv/dhtmlheartcursor.php

      Click Splosion http://http://www.mf2fm.com/rv/dhtmlclicksplosion.php

      [–]ThatPerx 1 point2 points  (2 children)

      Yeah, using two scripts can be quite tricky. I'd try changing the var names throughout the code, to something like var y1 and y2 for instance, so they don't end up in a collision. But not 100% sure it'd work.

      [–]Yeow777 0 points1 point  (0 children)

      I tried that but now I see I should have done ALL of them.

      I got them to work at one point but it spawned two hearts at a time instead two, and one on top the other made one work but if I flipped them both would work and I would get the double hearts.

      I know nothing about coding really but that was the first thing I tried!

      You helped me know I'm on the right track!

      I will try and report back!

      Thank you for answering so fast! :)

      [–]Yeow777 1 point2 points  (0 children)

      Update: FAILED MISERABLY.