Jump to content

Problems with "window.staus='Some text'"


LaLaLa

Recommended Posts

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

Can anyone help me? Please!

Link to comment
Share on other sites

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

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

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... :):blink::blink:
Link to comment
Share on other sites

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

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

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... :):):blink:
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...