Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 用于mouseover的jQuery移动等价物_Android_Jquery_Hover_Equivalent - Fatal编程技术网

Android 用于mouseover的jQuery移动等价物

Android 用于mouseover的jQuery移动等价物,android,jquery,hover,equivalent,Android,Jquery,Hover,Equivalent,我有一个功能,当光标悬停时,它在一系列缩略img选项卡中被激活 图像显示:块和位置:绝对,位置顶部和大小在鼠标上方发生变化 如何在Android或iPhone/iPad Safari上复制相同的内容。您可能希望将点击事件绑定到缩略图,而不是鼠标悬停。我相信iOS上的Safari可能已经将悬停事件解释为点击/点击,因此在这种情况下不需要做任何事情,但这可能只适用于CSS:hover伪类,而不是mouseover。@android中的Didier Levy,因为没有光标,你无法赋予它类似的效果 你能

我有一个功能,当光标悬停时,它在一系列缩略img选项卡中被激活

图像显示:块和位置:绝对,位置顶部和大小在鼠标上方发生变化


如何在Android或iPhone/iPad Safari上复制相同的内容。

您可能希望将点击事件绑定到缩略图,而不是鼠标悬停。我相信iOS上的Safari可能已经将悬停事件解释为点击/点击,因此在这种情况下不需要做任何事情,但这可能只适用于CSS:hover伪类,而不是mouseover。

@android中的Didier Levy,因为没有光标,你无法赋予它类似的效果

你能做的是,你可以使用一些.xml文件,改变按钮的背景和更多

首先在bg_button.xml中创建一个新的android.xml文件到项目的res/drawable目录中

内容将是

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
      android:drawable="@drawable/bg_button_ov" /> <!-- pressed -->

<item android:state_focused="true"
      android:drawable="@drawable/bg_button_ov" /> <!-- focused -->

<item android:drawable="@drawable/bg_button_n" /> <!-- default -->
</selector>
使用@drawable资源获得您想要的效果

现在转到,将此效果添加到按钮

 <Button
        android:id="@+id/button_save"
        android:layout_width="80dp"
        android:layout_height="fill_parent"


        android:background="@drawable/bg_button" <!-- drawable resource used here-->

        android:text="@string/Save"
        android:textSize="10dp"
        android:textStyle="bold" />