javascript - 鼠标悬停模拟触发工具提示 - JQuery Mobile / Javascript
问题描述
是否有多种鼠标悬停模拟可以显示工具提示/气泡?这是尝试通过修改 HTML 元素的类来实现此效果的小提琴。但是,除非您手动悬停,否则它不起作用。
http://jsfiddle.net/tearex/5e4mybok/13/
这是代码
<div id="test"></div>
<table width="70%" border="0" align="center">
<tr>
<!-- <td> </td>-->
<td>
<div data-role="fieldcontain" width="30%">
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<legend></legend>
<input type="radio" id="radio1_1" value="2" accesskey="–" checked class = hovered/>
<label for="radio1_1" href="#" title="hovering...">Hover here</label>
</fieldset>
</div>
</td>
</tr>
</table>
脚本
$(document).on('pageinit', function() {
$("#radio1_1").mouseenter();
theElement.onmouseover = function(){theElement.className += ' hovered'};
})
CSS
.hover { background-color: #ebebeb; }
#radio1_1 { border: 1px solid #c3c3c3; width: 200px; height: 200px;}
解决方案
推荐阅读
- python - 使用 glTF-Blender-IO 批量导出场景集合或选定对象
- python-3.x - 如何在 python 中使用 Fastxml 算法来预测输出列的值?
- javascript - 如何将 blob URL 转换为音频文件并将其保存到服务器
- oracle - JDBC 故障转移连接字符串
- c# - Xero API - 如何使用 ContactID 检索个人联系人?
- apache-kafka-streams - num.stream.threads 创建空闲线程
- docker - Docker:使用不安全的注册表而不修改 daemon.json
- python - 如果我的脚本包含来自 .py 模块的导入,Pyinstaller 不会生成 .exe 文件
- google-sheets - 将重复的数字复制到另一个单元格或谷歌表
- linux - dos2unix 覆盖原始文件所有者名称