![]() |
Javascripts |
|
Making and Linking to External .js filesYou can make a .js file from any normal javascript by stripping out the opening and closing tags.<script> </script> Let me show you what I mean! Here is a javascript for vertical scrolling text.
To
make the above into a .js file, simply take out the first line Copy and paste that code into windows notepad and save it as scroller.js or whatever. Make sure when you save the file you choose "Save as type" is set to "All files". Linking the .js fileOn the page you want the scrolling text to appear place this simple code below. You can place it on as many pages as you want:
Now each time you want to change that scrolling text you only need to edit that one scroller.js file. The best program to edit .js files with is called EditPlus. You can download it from http://www.editplus.com/download.html It's only 1 mb download. Even though it says 30 day trial it never stops working after that time. If you want to use this vertical scrolling text script, to change the text, you open your scroller.js file in EditPlus and go to line 7. That line must have this on it: var scrollercontents='Your Text Here' Your text must be between the two ' ' and you can also insert HTML tags to choose color and links etc. You'll notice I have some text and HTML in that line already. You simply take that out and place your own in. Linking to external .js files saves you a lot of time and trouble. |
|