我正在使用 jquery mobile 和 HTML5 开发一个移动页面。
我想更改 div 颜色(最初颜色为黑色),当我按下(点击或单击)该 div 时,我想将该 div 的颜色从黑色更改为白色,并且在我移除我的点击后,即在我取出我的那个 div 的手指我想像以前一样恢复为黑色。
有这种活动吗?请在这方面帮助我。在此先感谢。
<!--START:Initial state of Div Where i want to change color to white when i press that div and change back to normal after i remove my finger-->
<div class="colorBlack inactive"><div>
<!--END:Initial state of Div Where i want to change color to white when i press that div and change back to normal after i remove my hand-->
<!--START: Div class is changed to colorWhite,when i am tapping that div or i am holding that div with my finger-->
<div class="colorWhite active"><div>
<!--END: Div class is changed to colorWhite,when i am tapping that div or i am holding that div with my finger-->
<!--START: Div class is changed back to colorBlack,when i remove my finger -->
<div class="colorBlack active"><div>
<!--START: Div class is changed back to colorBlack,when i remove my finger -->