0
我正在尝试使我的移动网络应用显得更具响应能力。所以,当你点击一个图像的图标,我想使用jQuery的手机,而它被点击显示不同的图像(不同的颜色),使它看起来有些事情已经完成,然后当你放手它应该改回来。按钮点击伪造
我在尝试以下,但它似乎并没有被解雇。任何人有任何提示?
$(document).ready(function() {
$('.homeAlerts').on("vmousedown", "a", function() {
console.log("Clicked");
$('#homeAlerts').attr('src','mages/HomeIcons/typeOneClicked_0003_Alerts');
});
$('.homeAlerts').on("vmouseup", "a", function() {
$('#homeAlerts').attr('src','mages/HomeIcons/typeOne_0003_Alerts.png');
});
});
标记
<div class="iconL">
<a href="#alerts" class="homeAlerts">
<img id="homeAlerts" src="images/HomeIcons/typeOne_0003_Alerts.png" />
<center class="pullup">Alerts</center>
</a>
</div>
'$(“a.homeAlerts”)。on(........)'。编辑:不要在jQM中使用'.ready()',使用[page events](http://jqmtricks.wordpress.com/2014/03/26/jquery-mobile-page-events/)。 – Omar
在您发布的HTML标记中的任何'.homeAlerts'元素内没有锚标签 –
homeAlerts是锚标签,但? – TMB87