Change image map
|
|
Hello, Is there any possibility to change (override) an image map, if I have access only to the .css file and can use java scripts? The image map is stored in html (that I can't write), using the <map> element.</map> |
|
|
Hey people - don't be afraid to put "javascript" into one word, it is an entity all it's own not related to Java, Sun or anything by MS. The spell checker seems to like "JavaScript", so therefor this site contains JavaScript scripts (or JavaScripts, scripts or JS scripts if you really need to use acronyms), or more technically Greasemonkey scripts or GM scripts. Anyway, image maps would be interesting, I'll have to try that. First, it has to be a "client side" image map - see the spec: http://www.w3.org/TR/html401/struct/objects.htm... - no it's not that hard to understand, I refer to it all the time.
|
|
|
Okay, so JavaScript. The first I have learned on this site. :) Thank you for the quick reply, I will look over the site you linked. Well, I need this for a specified use, in Travian game (as many other scripts on this site).
|
|
|
I'd like to see a sample of the code, if you can view page source or better yet select an area and from right-click View Selection Source, select and copy the map and some of the A elements. Paste it here making sure to add a space after the < something like this: |
|
|
Here is the map's source code: < map name="rx">
(Here's nineteen definitions...) < area href="build.php?id=18" coords="190,232,28" shape="circle" title="Clay pit level 1">
And the call of the map:
The game map's graphic contains three layers, the lowest is the background, the second is a layer with numbers, indicating things for the game, and the third one is this "resfeld", a whole transparent layer with the image map. The definiton of "resfeld" is in the .css file that I can write, so I can turn of this layer (turning of the image map).
EDIT: Hmmm, that "pre" thing doesn't work for me. :( |
|
|
OK, I think I'm starting to understand what you're wanting to do. And that's a typical image map, so accessing it's properties should be no problem, in fact they should be in the document.links list but XPath would be easier.
|
