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
Release: 2016-06-24 11:50:15
Original
1703 people have browsed it


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>
Copy after login

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, tag. You can only find the coordinates on the picture yourself.

Forget it, disperse and solve it yourself

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template