Home >Web Front-end >HTML Tutorial >How to add events to the area on the image_html/css_WEB-ITnose

How to add events to the area on the image_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 11:50:151705browse


In the picture above, I want to add an event to the small white triangle on the disk in the picture. In what way, it is best to have code guidance


Reply to the discussion (solution)

<html><head>    <title>Index</title>    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>	<style>			</style></head><body><img src="imges/404.png"/><img src="imges/404.png"/><img src="imges/404.png"/><img src="imges/404.png"/></body><script> 	for(var i = 0; i <$('img').length; i++){		(function(i){			$('img').eq(i).click(function(){				alert(i);			})		})(i)	}</script></html>

The picture above is one picture, not put together. Now I need to click on the small triangle area in the picture to trigger the event

You can use the hotspot map, http://www.cnblogs.com/wangyuelang0526/archive/2012/05/16/2503732.html, I hope it can help you

http://www.w3school .com.cn/tags/tag_area.asp, see for yourself, 03fc64e1e502d5ba947b3a9af06d2d2a tag. You can only find the coordinates on the picture yourself.

Forget it, disperse and solve it yourself

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn