Help - Search - Members - Calendar
Full Version: Picture Links in Javascript
Forums > Resource Center > Webmasters' Corner > Webmasters' Corner Resolved Topics
Fireshrieker
Does anyone know how to/if you can link a picture to a URL in javascript? I mean like using the image as a link. I want to try this code:

CODE
<!-- begin code provided by createblog.com -->
<!--http://www.xanga.com/anti_fukin_social-->
<script language="Javascript">
//paste in custom header only

//your screen name below
var mysn="frozenshadowfox";

//the message before your AIM Status
var themsg="I am currently";

//picture to show when you are online
var onlinepic="http://www.aimfilez.com/online.gif";

//picture to show when you are offline
var offlinepic="http://www.aimfilez.com/offline.gif";

//no need to edit here
document.write(themsg + " <IMG SRC=http://big.oscar.aol.com/" + mysn + "?on_url=" + onlinepic + "&off_url=" + offlinepic + ">.");
</script>

<!-- end code provided by createblog.com -->


and have the pictures as links to IM me.

can anyone help?
TwistMe
I don't know if this is what you were looking for but here is a code to make a picture a link.

CODE
<!-- begin code provided by createblog.com -->
<A href="PUT THE URL OF THE SITE YOU WANT TO LINK THE PICTURE TO" target=_new><IMG src="THE PICTURE'S URL" border=0></A>
<!-- end code provided by createblog.com -->
LatinaLady
are you saying to change the pic just replace the ones that are in the code and it should work with the links
Fireshrieker
QUOTE(LatinaLady96 @ Apr 29 2004, 3:44 PM)
are you saying to change the pic just replace the ones that are in the code and it should work with the links

um.. i'm not sure i get your wording.

anyway, for those of you who are confused- i mean, to have pictures in the javascript that when you click on them, they send you to a URL (the same as a picture link, but in javascript)
Fireshrieker
Here, this code is what i'm talking about:

QUOTE
<!-- Start Bravenet.com Service Code -->
<script language="JavaScript" type="text/javascript" src="http://pub44.bravenet.com/counter/code.php?id=377040&usernum=3717098755&cpv=2"></script>
<!-- End Bravenet.com Service Code -->


now what that does is it has a picture where when you click on it, it sends you to that address. I want to incorporate that code into this one:
QUOTE
<!--http://www.xanga.com/anti_fukin_social-->
<script language="Javascript">
//paste in custom header only

//your screen name below
var mysn="frozenshadowfox";

//the message before your AIM Status
var themsg="I am currently";

//picture to show when you are online
var onlinepic="http://www.aimfilez.com/online.gif";

//picture to show when you are offline
var offlinepic="http://www.aimfilez.com/offline.gif";

//no need to edit here
document.write(themsg + " <IMG SRC=http://big.oscar.aol.com/" + mysn + "?on_url=" + onlinepic + "&off_url=" + offlinepic + ">.");
</script>


anyone know how?
[2]Nekked
um.. thats what that code already does.

just replace the image sources with your own images:

CODE
<!-- begin code provided by createblog.com -->
//picture to show when you are online
var onlinepic="http://www.aimfilez.com/online.gif";

//picture to show when you are offline
var offlinepic="http://www.aimfilez.com/offline.gif";


<!-- end code provided by createblog.com -->
Fireshrieker
QUOTE([2)
Nekked,Apr 29 2004, 5:12 PM] um.. thats what that code already does.

just replace the image sources with your own images:

CODE
<!-- begin code provided by createblog.com -->
//picture to show when you are online
var onlinepic="http://www.aimfilez.com/online.gif";

//picture to show when you are offline
var offlinepic="http://www.aimfilez.com/offline.gif";


<!-- end code provided by createblog.com -->

eh. i wish it were that easy.

actually, all that code does is check whether you're online or not, then puts the corresponding picture up. I have the code at the bottom of my own xanga - http://www.xanga.com/fireshrieker and it's nothing but a simple picture




EDIT- darn. i was saving that 1000 post for something better. oh well.
[2]Nekked
QUOTE(Fireshrieker @ Apr 29 2004, 11:34 PM)
eh. i wish it were that easy.

actually, all that code does is check whether you're online or not, then puts the corresponding picture up. I have the code at the bottom of my own xanga - http://www.xanga.com/fireshrieker and it's nothing but a simple picture




EDIT- darn. i was saving that 1000 post for something better. oh well.

THATS WHY U CHANGE THE IMAGE SOURCES!!
make your own image.
upload it.
change

http://www.aimfilez.com/online.gif

http://www.aimfilez.com/offline.gif

to the urls of your own images.
oh jeez i feel an oncoming migrane..
Fireshrieker
QUOTE([2)
Nekked,Apr 30 2004, 11:03 AM] THATS WHY U CHANGE THE IMAGE SOURCES!!
make your own image.
upload it.
change

http://www.aimfilez.com/online.gif

http://www.aimfilez.com/offline.gif

to the urls of your own images.
oh jeez i feel an oncoming migrane..

okay, i think there's a misunderstanding here.

for me, the picture isn't the problem- the problem is, i couldn't get that picture to be a link (NOT i couldn't get the link to be the right picture)

do you get what i mean? or should i reword it?
[2]Nekked
QUOTE(Fireshrieker @ Apr 30 2004, 2:24 PM)
okay, i think there's a misunderstanding here.

for me, the picture isn't the problem- the problem is, i couldn't get that picture to be a link (NOT i couldn't get the link to be the right picture)

do you get what i mean? or should i reword it?

i gave you a link for this already in a different thread.

http://www.onlinestatus.org/

and it does work. i use it on my site.

oh and in your privacy settings on aim.. if u have it set to block anyone that isnt on your list, then it will just say you're offline.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.