LaLaLa Posted September 12, 2006 Share Posted September 12, 2006 I'm having problems with a linked image-map...Is there anyway to make the browser display the Staus Bar text (window.status='') that I want it to instead of the image-map link U.R.L.? The code is below:LaLaLa <html><body><map id="links" name="links"><area shape="rect" coords="0,0,100,100" alt="Other Page" href="My Other Page.htm" onmouseover="window.status='Click here to go to my other page'"></map><img src="Some big picture that I have.jpg" usemap="#links"></body></html> Link to comment Share on other sites More sharing options...
LaLaLa Posted September 17, 2006 Author Share Posted September 17, 2006 Can anyone help me? Please! Link to comment Share on other sites More sharing options...
Webworldx Posted September 18, 2006 Share Posted September 18, 2006 Hi there LaLaLa.Most browsers won't display the status text on image maps if you've got a href attribute, so the workaround is to use onclick. <html><body><script type='text/javascript'>function gotoPage(page){ window.location.href = page;}</script><map id="links" name="links"><area shape="rect" coords="0,0,100,100" alt="Other Page" onclick="gotoPage('My Other Page.htm')" onmouseover="window.status='Click here to go to my other page'"></map><img src="Some big picture that I have.jpg" usemap="#links"></body></html> Link to comment Share on other sites More sharing options...
LaLaLa Posted September 22, 2006 Author Share Posted September 22, 2006 Hi there LaLaLa.Most browsers won't display the status text on image maps if you've got a href attribute, so the workaround is to use onclick.<html><body><script type='text/javascript'>function gotoPage(page){ window.location.href = page;}</script><map id="links" name="links"><area shape="rect" coords="0,0,100,100" alt="Other Page" onclick="gotoPage('My Other Page.htm')" onmouseover="window.status='Click here to go to my other page'"></map><img src="Some big picture that I have.jpg" usemap="#links"></body></html> Ok, thanks for the help! Sorry I took so long to look at this...Umm... well, it worked, but I don't understand the coding of it.What does each part do? If the onclick="gotoPage('My Other Page.htm')" is a function, why do you put the link address in the where function is called, why not in the actuall function? Can you explain how this works? Also, can I use the same function [<script type='text/javascript'>function gotoPage(page){window.location.href=page}</script>] with lots of onclick commands, as long as I change the address where the function is called [gotoPage('My Other Page.htm')]? Link to comment Share on other sites More sharing options...
Webworldx Posted September 22, 2006 Share Posted September 22, 2006 Hi again,Just change:onclick="gotoPage('My Other Page.htm')"toonclick="gotoPage('Whatever_Page.php')"etc, and you can use as many gotoPage(..)'s on the page as you like Link to comment Share on other sites More sharing options...
LaLaLa Posted September 27, 2006 Author Share Posted September 27, 2006 Hi again,Just change:onclick="gotoPage('My Other Page.htm')"toonclick="gotoPage('Whatever_Page.php')"etc, and you can use as many gotoPage(..)'s on the page as you like Couldn't you just put what's in the function (window.location.href="") in the actual onlclick thingy? Besides, I have 5 images maps and it didn't work right when I hooked all 5 up the same way I did the first one... Link to comment Share on other sites More sharing options...
LaLaLa Posted September 27, 2006 Author Share Posted September 27, 2006 Also, I'm wondering how you would get the curser to change into a finger (like when over a hyper-link),BUT, only when it's over one of the linked image-maps. I know you have to use styles, but how would you get it to only affect a certain part?LaLaLa Link to comment Share on other sites More sharing options...
aleksanteri Posted September 27, 2006 Share Posted September 27, 2006 Also, I'm wondering how you would get the curser to change into a finger (like when over a hyper-link),BUT, only when it's over one of the linked image-maps. I know you have to use styles, but how would you get it to only affect a certain part? <area shape="rect" coords="0,0,100,100" alt="Other Page" onclick="gotoPage('My Other Page.htm')" onmouseover="window.status='Click here to go to my other page'" style="cursor:link"> Link to comment Share on other sites More sharing options...
Webworldx Posted September 29, 2006 Share Posted September 29, 2006 Couldn't you just put what's in the function (window.location.href="") in the actual onlclick thingy? Besides, I have 5 images maps and it didn't work right when I hooked all 5 up the same way I did the first one... You could - i'm not much of a fan of inline javascript like that if I can help it though =) <area shape="rect" coords="0,0,100,100" alt="Other Page" onclick="gotoPage('My Other Page.htm')" onmouseover="window.status='Click here to go to my other page'" style="cursor:link"> Isn't it cursor: pointer ? Link to comment Share on other sites More sharing options...
LaLaLa Posted October 1, 2006 Author Share Posted October 1, 2006 You could - i'm not much of a fan of inline javascript like that if I can help it though =)Isn't it cursor: pointer ?Thanks you guys! I've figured it all out now.BTW, it is <style "cursor:pointer">...LaLaLa Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now