+8  A: 

You don't really need Javascript for this. This is achieved by giving an element a position of fixed:

<a id="floating_link" href="whatever.html">Go Somewhere</a>

#floating_link {
     position: fixed;
     right: 0;
     top: 400px;
     display: block;
     width: 50px;
     height: 125px;
     text-indent: -10000px;
     background-image: url(/my/image.jpg);
     overflow: hidden;
}

Unfortunately, IE6 doesn't support fixed. You can get around that by using this plugin.

If you don't care about IE6, then you can just use the above. The only difference is that IE6 will treat it as an absolute element (so it won't scroll down with the page, which isn't a big deal)

Here is an example of it at work. As you can see the entire area is clickable.

Paolo Bergantino
Great answer, thanks. How can I make the entire content of the #floating_link clickable? With just an a-href, if possible. I can surround the div by an a-tag, but nesting divs inside anchors seems very dirty.
Kjensen
As it is right now the entire link should be clickable. What behavior are you getting?
Paolo Bergantino
I completely overlooked the fact that you had actually also inserted a link, sorry. It works perfect, thanks again! :)
Kjensen
No problem. I added a live example in anyways.
Paolo Bergantino