我正在使用 wowslider 进行幻灯片放映。我想在单击特定图像时执行一个功能。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="engine1/style.css" />
<script type="text/javascript" src="engine1/jquery.js"></script>
</head>
<body style="background-color:transparent;margin:auto">
<div id="wowslider-container1">
<div class="ws_images"><ul>
<li><img src="data1/images/1.jpg" alt="1" title="1" id="wows1_0"/></li>
<li><img src="data1/images/2.jpg" alt="2" title="2" id="wows1_2" ondblclick="show()" /></li>
<li><img src="data1/images/3.jpg" alt="3" title="3" id="wows1_3"/></li>
<li><img src="data1/images/4.jpg" alt="4" title="4" id="wows1_4"/></li>
<li><img src="data1/images/5.jpg" alt="5" title="5" id="wows1_5"/></li>
<li><img src="data1/images/6.jpg" alt="6" title="6" id="wows1_6"/></li>
<li><img src="data1/images/7.jpg" alt="7" title="7" id="wows1_7"/></li>
</ul></div>
<div class="ws_thumbs">
</div>
<div class="ws_shadow"></div>
</div>
<script type="text/javascript" src="engine1/wowslider.js"></script>
<script type="text/javascript" src="engine1/script.js"></script>
<script type="text/javascript">
function show() {
window.alert("checked");
}
</script>
</body>
</html>
这是我的代码。我通过在图像上添加 doube click 属性进行了尝试。但它不起作用。建议高度赞赏。提前致谢 :)