Free javascripts
The most commonly asked for. If you use any of these, please link back to my site. Thanks.
Have an image rollover on your page
Take a look at the image below, and run your pointer over it. you will see that it changes, then goes back to the
original once the pointer moves off.
This is taken from another section of my site, where I used it to show people screen shots of a photo gallery.
Very easy to do with javascript, and this will show you how to add it to your page.
The same effect could be done with css as well, but I will put that on another page. right, let's get started.
First, we need some code either in the head of your page, or a text block for those using block builder.
Right click in the texbox, and "Select All"
Change the image name and locations to your own. So if you upload them to the graphics library, that would be
images/imagename.jpg. Also, put in your correct image dimensions. Try and make them the same size if you can....
otherwise you can get funny results!
Also, see the second function has a name? It's ajimageswap. This is needed, because we will give our image a name later,
and the script needs that, to be able to find it. Right, here's the second part of the code, placed where you want
to see the images.
This is pretty self explanatory, but a few things to be aware of. First, a javascript like this NEEDS
an href....it wont work without a link. If you want to link the image to another page, then put the URL in there.
I didnt want to link anywhere, so I used #.
Next, as it is a link (regardless of whether it goes anywhere or not) I put border="0" in. That stops the blue
hyperlink line around my image.
And the last thing, make sure you use the same name as you did in the previous section. That's it, have fun with it
and Im sure you will find it useful.
Hide an affiliate link in the status bar.
Often, the vendow will have cloaking of the link. However, if you hover over the link before
clicking on it, then the affiliate ID will still show in the status bar.
Here's how to hide that.
<a href="X" onmouseover="window.status='Y'; return true;"
onmouseout="window.status=''; return true;">Your link text or banner</a>
X=your affiliate ID. Y=The landing page URL.
I haven't tested this in all browsers. however, if it won't work, you're no worse off....the link will still work.
List Your Links
Okay, so this isn't requested a lot, but why would you ask for something if you don't know
about it? I think you will find it very useful, in the right circumstances.Click on the button below and see what happens.
Pretty cool huh? Have you got one of those long tier 2 pages, broken up into sections with anchors, and links off
to assorted tier 3 pages?
Then perhaps a button like this could help your visitors see all the links at a glance,
without cluttering up the page with a big long list. Heres the code for this.Place this in the head of your page
Right click in the texbox, and "Select All"
Now place this in the body of the page, where you want the button to appear.
Right click in the texbox, and "Select All"
Display HTML On A Webpage
Actually, this has no business at all being on this page - it's not a script at all. But not to worry ;-).
I think you're going to like this, if you dont already know it.
So, how can you get HTML to display, without the use of a textbox, and without
using the common &lgt; tag?.
Very simple - HTML supports a tag especially for this purpose (it is out of date now, but don't worry, it still works just fine).
< xmp > and < /xmp >
Just wrap your code in these tags, and it will display as written.
Is that easy or not? Simple and practical.
Note that if you decide to do this with a php script, it could execute, as php is serverside, and HTML is clientside.
You will need to change the ?php tag to disable it.
|