jquery - 使用 jQuery 在悬停时摇动
问题描述
我正在尝试在 jQuery 中制作一个框架按钮悬停效果。请帮助我想在悬停时摇动锚标签
它看起来像这样:
$(document).ready(function() {
$(".neon").hover(function() {
$(this).toggle().effect("shake")
})
})
解决方案
这可以解决问题。
$("#toggle").hover(function() {
$( "#toggle" ).effect( "shake", {times:2}, 1000 );
});
<!doctype html>
<html lang="en">
<head>
<script src="//code.jquery.com/jquery-1.12.4.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>
<p>Click anywhere to shake the box.</p>
<div >
<a href="" id="toggle">Try</a>
</div>
推荐阅读
- python - 从命令行运行 Python 脚本时出现 ValueError
- ibm-mq - 在 IBM MQ 本地安装上配置 Rest
- c++ - 在 AVR ATmega1280 PORTF 和 PORTK 上启用数字输入缓冲器
- java - 我的 JPA 存储库请求正在返回缓存,而我没有在 Spring Boot 中启用它
- python - 如何对包含多个数字的字符串进行自然排序
- batch-file - 批处理文件仅删除超过 n 天的文件
- express - 使用 express 托管 UI5 webapp
- python - 如何让精灵一一出现
- javascript - 如果附件存在,SendGrid 发送函数没有响应
- python - 如何从 Python 中重复的 Proto 字段中删除所有元素?