用于mouseover的jQuery移动等价物



我有一个函数,当光标悬停时,它会在一系列缩略图img选项卡中激活。

图像显示为:块和位置:绝对以及鼠标悬停时的位置(顶部)和大小变化。

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

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

@Didier Levy在android中,因为没有光标,所以你不能给它类似的效果。。

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

首先在bgbutton.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" />

最新更新