在我的移动应用程序中,我需要在网页周围移动绿色图像。当绿色图像悬停在提交按钮上时,按钮将显示“提交?”,当用户将绿色图像放在提交按钮上时,按钮将变为橙色。
这是图片:
问题是当绿色图像悬停在按钮上时,按钮无法更改,只有当我触摸按钮时它才能更改。我尝试过 hover() 和 mouseover() 方法,都没有用。它是jQuery Mobile,在我的 PC 版本中,一切运行良好,但移动应用程序不同。
那么,当绿色图像悬停在按钮上时,我该怎么做才能显示“提交?”?或者当绿色图像悬停在其中一个对象上时,有什么方法可以检测对象是“是”还是“否”按钮?
这是代码:拖放方法来自另一个JS文件,但不应该影响这个问题。
id = "html";
$(id).ready(function (e) {
$('.yes').bind('mouseover', function( event, ui ){
$('.yes').attr("src","images/submit_confirm.png");
$('input[name=stimulusResponse]').val("yes");
$('.no').attr("src","images/no.png");
});
$('.no').mouseover(function( event, ui ){
$('.no').attr("src","images/submit_confirm.png");
$('input[name=stimulusResponse]').val("no");
$('.yes').attr("src","images/yes.png");
});
$('.bottomGoButton').drag(function( ev, dd ){
$( this ).css({
top: dd.offsetY,
left: dd.offsetX
});
$(this).bind('vmousemove', function(event) {
$('input[name=test]').val(event.pageX + ", " + event.pageY + $('input[name=test]').val());
});
});
$('.no').drop(function(){
$('input[name=stimulusResponse]').val("no");
$('.no').attr("src","images/submitted_no.png");
});
$('.yes').drop(function(){
$('input[name=stimulusResponse]').val("yes");
$('.yes').attr("src","images/submitted_yes.png");
});
});