virtualadz Posted May 19, 2006 Share Posted May 19, 2006 i have a image map which i want the text to hide on mouseout, but it didn't, see the code below i have given mouseout but it doen't have any effetc.<script type="text/javascript">function writeText(txt){document.getElementById("desc").innerHTML=txt}</script><img src="world_map.bmp" usemap="#world_map" alt="" style="border-style:none" /><map id="world_map" name="world_map"><area shape="circle" alt="W3schools" coords="401,131,6" nohref title="India" onMouseOver="writeText('VirtualAdz')" onMouseOut="hide('desc')" /></map> Link to comment Share on other sites More sharing options...
scott100 Posted May 19, 2006 Share Posted May 19, 2006 Well for a start you need to put somewhere in the body for it to write to<div id="desc">o</div>Then it shoud work fine. Link to comment Share on other sites More sharing options...
virtualadz Posted May 19, 2006 Author Share Posted May 19, 2006 i forgto to add this in the ending<p id="desc"></p> Link to comment Share on other sites More sharing options...
virtualadz Posted May 19, 2006 Author Share Posted May 19, 2006 well, i had added <p id="desc"></p> this but forgto to post here, so need of the div, just need to hide text. Link to comment Share on other sites More sharing options...
scott100 Posted May 19, 2006 Share Posted May 19, 2006 i forgto to add this in the ending<p id="desc"></p><{POST_SNAPBACK}> Well then your code works fine, if i use the w3schools logo and change the coordinates everythings good (mouseover top left corner)You must have incorrect coordinates or something <head><script type="text/javascript">function writeText(txt){document.getElementById("desc").innerHTML=txt;}</script></head><body><img src="http://w3schools.invisionzone.com/style_images/w3sbanner.gif" usemap="#world_map" alt="" style="border-style:none" /><map id="world_map" name="world_map"><area shape="circle" alt="W3schools" coords="10,10,6" nohref title="India" onMouseOver="writeText('VirtualAdz')" onMouseOut="hide('desc')" /><div id="desc">o</div></map> </body> Link to comment Share on other sites More sharing options...
virtualadz Posted May 19, 2006 Author Share Posted May 19, 2006 hey but your code didn;t hide it on my pc Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 19, 2006 Share Posted May 19, 2006 scott's code called an undefined function "hide"try this: <html><head><script type="text/javascript">function writeText(txt){document.getElementById("desc").innerHTML=txt;}function hide(txt){document.getElementById("desc").innerHTML=txt;}</script></head><body><img src="http://w3schools.invisionzone.com/style_images/w3sbanner.gif" usemap="#world_map" alt="" style="border-style:none" /><map id="world_map" name="world_map"><area shape="circle" alt="W3schools" coords="10,10,6" nohref title="India" onMouseOver="writeText('VirtualAdz')" onMouseOut="hide('')" /><div id="desc"></div></map></body><html> Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 19, 2006 Share Posted May 19, 2006 you know, maybe one of these days i'll learn to think before i post. <html><head><script type="text/javascript">function writeText(txt){document.getElementById("desc").innerHTML=txt;}</script></head><body><img src="http://w3schools.invisionzone.com/style_images/w3sbanner.gif" usemap="#world_map" alt="" style="border-style:none" /><map id="world_map" name="world_map"><area shape="circle" alt="W3schools" coords="10,10,6" nohref title="India" onMouseOver="writeText('VirtualAdz')" onMouseOut="writeText('')" /><p id="desc"></p></map></body><html> Link to comment Share on other sites More sharing options...
virtualadz Posted May 19, 2006 Author Share Posted May 19, 2006 hey but your code in post #7 did the work for me,it's working, let me try the second one, but why is the second one (post #8) needed Link to comment Share on other sites More sharing options...
virtualadz Posted May 19, 2006 Author Share Posted May 19, 2006 the second one doesn't work i tried , post #7's good Link to comment Share on other sites More sharing options...
virtualadz Posted May 19, 2006 Author Share Posted May 19, 2006 "you know, maybe one of these days i'll learn to think before i post."this is infact same for me, your 2nd one did work. ah now i have the hext issue regarding this thing Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 19, 2006 Share Posted May 19, 2006 your code and scott's code didn't work because you were calling an undefined function: hide.in my first post, i simply created the hide function, then i had a bto (blind flash of the obvious) and simply called the writetext code both times, changing the parameter. Link to comment Share on other sites More sharing options...
scott100 Posted May 19, 2006 Share Posted May 19, 2006 hey but your code didn;t hide it on my pc<{POST_SNAPBACK}> That's because you never posted that function, you only posted the function that changes the text All you had to do was add it in...Anyway, thanks to Kosher Kid for standing in while i was away Link to comment Share on other sites More sharing options...
virtualadz Posted May 20, 2006 Author Share Posted May 20, 2006 hi ok my next question is : i want to insert <br> <b> and such tags within the function "writetext('VirtualAdz<br>dad<b>dad</b>dada<br>da')" but when validating it with w3.org , these tags are shown as errors and they can't be included there. is there a other way i can add text out here with <br> and <b> etc. Link to comment Share on other sites More sharing options...
virtualadz Posted June 7, 2006 Author Share Posted June 7, 2006 ok hi , now making the image map further more complex. i want a world clock and or that what i want is suppose, if someone moves mouse over US in the map then the time is shown, now do i make a rotating clock. is there a way or is it too complex. Link to comment Share on other sites More sharing options...
Chocolate570 Posted June 13, 2006 Share Posted June 13, 2006 We're not here to write code for you, i'm sorry to say. You'll just have to figure it out, and we'll guide you in the right direction. Link to comment Share on other sites More sharing options...
virtualadz Posted June 13, 2006 Author Share Posted June 13, 2006 well, thnks, but i have dropped this js world clock scripting, it's easir i think to make it in flash than javascript. Link to comment Share on other sites More sharing options...
reportingsjr Posted June 15, 2006 Share Posted June 15, 2006 You know you could probably write one is C++ or C# make it a cgi thing. Link to comment Share on other sites More sharing options...
Chocolate570 Posted June 15, 2006 Share Posted June 15, 2006 Graphics and C++ do not go well together if you don't have 50 years to learn them. Link to comment Share on other sites More sharing options...
Skemcin Posted June 15, 2006 Share Posted June 15, 2006 years ago I was contracted to for a job where I created this look and feel:http://www.lessonlab.comI'm not sure how large your imagemap is, but the mouseovers down the middle here are images - I used a simple rollover script and embedded my text in the image.Without more information or a visualation of your page/image, I am not sure if this solution would be feasible - but, the idea of embedding your text in your image and then using a rolloever might be worth exploring - even if you have several different text messages that need to be overlayed, just make more copies fo your imagemap with that text embedded.It may seem like a lot of work, but if done properly, the benefits outweigh the means. For instance, this solutions is better for search engines because the links and the text (img alt text) are able to be spidered by search engines - very important for this client. If you use div and display:none; then all that text is not typically accessible to search engine spiders.Just a thought . . . Link to comment Share on other sites More sharing options...
virtualadz Posted June 18, 2006 Author Share Posted June 18, 2006 what i neede was: a image map, as world clock, i.e. whenever someone hovers over a area, a time is shown, but i dont want to manually update the time, rather a clock, and the time updates itslef auto, may be it could be done using js. but i have no idea. that's way thought of flash as a better option I'm not sure how large your imagemap is see this for an example of the size Link to comment Share on other sites More sharing options...
scott100 Posted June 18, 2006 Share Posted June 18, 2006 It would work like this: http://www.onlineconversion.com/timezone.htmYou can have multiple times zones on a page. What you want to do is hide all of them to begin with, then whenever you mouseover a country show it's clock.That's one way it could be done Link to comment Share on other sites More sharing options...
virtualadz Posted June 18, 2006 Author Share Posted June 18, 2006 see this for an example:http://www.dhl.co.in/publish/in/en/tools/w...clock.high.htmlthe clock in there is a world map, made in java, but rather i want it in a image map using javascript. the clock wont be based on the visitor's computer. Link to comment Share on other sites More sharing options...
scott100 Posted June 18, 2006 Share Posted June 18, 2006 see this for an example:http://www.dhl.co.in/publish/in/en/tools/w...clock.high.htmlthe clock in there is a world map, made in java, but rather i want it in a image map using javascript.Yes i would think that you could recreate this with javascript. the clock wont be based on the visitor's computer.Well considering javascript gets its date object information from the system clock how do you plan on doing this? You would have to write times from the server Link to comment Share on other sites More sharing options...
virtualadz Posted June 18, 2006 Author Share Posted June 18, 2006 Well considering javascript gets its date object information from the system clock how do you plan on doing this? You would have to write times from the server can't a time be set, and that would rotate by every 24 hrs., let's say a time is set, 13:41 now through js the time will increase 13:42 , so no need of visitor's settings. bcoz this will be a world clock and the visitor's clock may not be correct. that's the point. 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