如何在聚焦或聚焦时更改图像,以便用户知道选择了哪个?(How to change images while focusing or focusing so that user know which i

编程入门 行业动态 更新时间:2024-10-10 23:26:28
如何在聚焦或聚焦时更改图像,以便用户知道选择了哪个?(How to change images while focusing or focusing so that user know which is selected?)

你能告诉我如何在jQuery Mobile中添加焦点和未聚焦的图像。 我添加一个按钮。 我需要改变想象中的图像吗? onfocus或非onfocus ,以便用户可以轻松识别。选择了哪个按钮或未选择哪个按钮。如果我有两个按钮,我想我需要检查选择了哪个按钮或哪个按钮未被选中?

你能告诉我怎么做这个任务吗?

我这样用

<div class="ui-block-c" style="margin-left: 5px;"> <a href="#" data-role="button" data-corners="false" data-inline="true" class="next_h" id="next">Next</a> </div> <div class="ui-block-d" style="margin-left: 30px;"> <a href="#" data-role="button" data-corners="false" data-inline="true" class="previous_h" id="prev">Previous</a> </div>

Can you please tell me how to add focus and unfocused image in jQuery Mobile. I add one button. I need to change images in think? onfocus or at unfocus so that it user can easily identify .Which button is selected or which button is unselected .If i have two button I think I need to check which button is selected or which button is unselected?

Can you please tell how to do this task?

I use like this

<div class="ui-block-c" style="margin-left: 5px;"> <a href="#" data-role="button" data-corners="false" data-inline="true" class="next_h" id="next">Next</a> </div> <div class="ui-block-d" style="margin-left: 30px;"> <a href="#" data-role="button" data-corners="false" data-inline="true" class="previous_h" id="prev">Previous</a> </div>

最满意答案

您可以简单使用:将鼠标悬停在动画悬停上。

或者为focusin和focusout事件添加如下所示的类;

使用CSS和jQuery;

$("a").focusin(function(){ $(this).addClass("selected"); }); $("a").focusout(function(){ $(this).removeClass("selected"); });

并定义一个新的CSS规则;

.selected { (add your selected picture as a background or another effect) }

如果你想要单独的背景图片;

.selected .next_h { (add your selected picture as a background or another effect) } .selected .prev_h { (add your selected picture as a background or another effect) }

You can simple use :hover to animate hover.

Or add a class as shown below for focusin and focusout events;

Using CSS and jQuery;

$("a").focusin(function(){ $(this).addClass("selected"); }); $("a").focusout(function(){ $(this).removeClass("selected"); });

And define a new CSS rule;

.selected { (add your selected picture as a background or another effect) }

If you want separate background pictures;

.selected .next_h { (add your selected picture as a background or another effect) } .selected .prev_h { (add your selected picture as a background or another effect) }

更多推荐

button,class,按钮,onfocus,电脑培训,计算机培训,IT培训"/> <meta name="descr

本文发布于:2023-08-06 09:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1447622.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选择了   图像   用户   如何在   change

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!