What language is used for this function?

I came to this website, and surfing: http://kurdon.com/?lang=en_US and on the main page there is an iraq map in which you can hover over it and it will highlight the details. clicking on it, connect it to the part page.

I thought he used for this function? is it javascript / jquery or something like that?

+4
source share
5 answers

They use only javascript for the map.

On the right side of the map there are links that contain the following:

onmouseover="change_map(1);" 

And the function defined in the line on the page:

 function change_map(region) { var MapItem = document.getElementById("imageRegions"); var ListItem = document.getElementById("region_" + region); MapItem.style.backgroundImage = 'url(/images/region_' + region + '.gif)'; MapItem.style.backgroundPosition = '0px 0px'; MapItem.style.backgroundRepeat = 'no-repeat'; ListItem.style.color = "#D0630A"; return true; } 

Areas of the map itself are implemented by image maps.

+9
source

This is an HTML image map, combined with javascript effects tied to onmouseover and onmouseout .

The image map defines the area by coordinates, and javacript changes color and applies other effects.

Try viewing the page source in the Chrome Web Developer or firebug developer tools to find out more.

+5
source

You can do this with HTML image maps, although I'm not sure if they are out of date.

See: http://en.wikipedia.org/wiki/Image_map#Definition_in_HTML

+4
source

This is just javascript controlling CSS.

+1
source

just looks like javascript to me, using a map and setting the correct coordinates for different regions and then changing color when someone does mouseover / mouseout

+1
source

Source: https://habr.com/ru/post/1387791/


All Articles