Rollovers in RLM - Post ID 240890

User 458539 Photo


Registered User
1,583 posts

Steve

I jumped the gun in understanding what this means - I have tried MANY variations - this one does not work

I have and images folder - the main image is artahm.png - - the rollover image I want is in images/arta r.png and want the click to go to page http://tippingproductions.com/tpc/demosite2/artahm.html

<a href="http://tippingproductions.com/tpc/demosite2/artahm.html"><img src="imageOne" onmouseover="this.src=images/artahm..png'" onmouseout="this.src=images/arta r.png'" /></a>

As I said I know this one doesn't work but all my variations don't work

Any help would be appreciated

Byron
User 458539 Photo


Registered User
1,583 posts

Hey Steve!

Think this works

<a href="http://tippingproductions.com/tpc/demosite2/artahm.html">
<img src="http://tippingproductions.com/tpc/demosite2/images/artahm.png" onmouseover="this.src='http://tippingproductions.com/tpc/demosite2/images/arta r.png'"
onmouseout="this.src='http://tippingproductions.com/tpc/demosite2/images/artahm.png'"
</a>

Playing with the demo A LOT so if you look it might be blown up

http://tippingproductions.com/tpc/demosite2/

THANKS!!!!!!!!

Byron
User 2088758 Photo


Senior Advisor
3,086 posts

Hey Byron yes you got it!!!!

Note you don't have to use the absolute path but it works as well. In your first try you just forgot to add the first image
Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA
User 458539 Photo


Registered User
1,583 posts

Thanks again Steve - not quite sure I understand you

Byron
User 38401 Photo


Senior Advisor
10,951 posts

What Steve is talking about is the way a pathway to a file is listed. There are 2 prominent ways to do this, one is called Absolute which includes the entire pathway written out as you have on yours. The other is called Relative which shows only the pathway as it pertains to the location of the page you're putting it on. In other words, it's written out depending on where the files are in relation to the page it's being included on.

This is what you have for your code as you posted :

<a href="http://tippingproductions.com/tpc/demosite2/artahm.html">
<img src="http://tippingproductions.com/tpc/demosite2/images/artahm.png" onmouseover="this.src='http://tippingproductions.com/tpc/demosite2/images/arta r.png'"
onmouseout="this.src='http://tippingproductions.com/tpc/demosite2/images/artahm.png'"
</a>


This can be shortened to this IF the page it's on is right in the main root directory where the index page is (or if this is the index page hehe).

<a href="tpc/demosite2/artahm.html">
<img src="tpc/demosite2/images/artahm.png" onmouseover="tpc/demosite2/images/arta r.png'"
onmouseout="this.src='tpc/demosite2/images/artahm.png'"
</a>

Notice that the entire domain name has been removed from the pathways of the links. That is because the server will automatically assume that whatever you are looking for is on your server when it doesn't include an HTTP:// address in it. In this case it will look in the same directory as the page that is open and being viewed.

If the page being viewed was in another directory other than the root then you would include that folder in the pathway with 2 dots in front of a slash at the start of each link as so:

<a href="../tpc/demosite2/artahm.html">
<img src="../tpc/demosite2/images/artahm.png" onmouseover="tpc/demosite2/images/arta r.png'"
onmouseout="this.src='../tpc/demosite2/images/artahm.png'"
</a>

This would tell it (for every set of ../) to go up one directory in the tree then to go into the directory "tpc" and follow the rest of the link. If it were put inside another directory within that directory you would see something like ../../ in front of the links in order to tell it to go up 2 directories in the tree before following the rest of the link.

Hope that makes sense. :)
User 458539 Photo


Registered User
1,583 posts

Sort of yes - thanks!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.