javascript - SyntaxError: missing ) 在参数列表后 - JavaScript - jQuery
问题描述
我收到此错误:
Uncaught SyntaxError: missing ) 在参数列表之后
这是我的 JavaScript / jQuery 代码:
jQuery(function($) {
$(".menu-toggle").hover(function() {
$("#Wrapper").css("transform", "perspective(900px) rotateY(-5deg)")
};
}, function() {
$("#Wrapper").css("transform", "perspective(0px) rotateY(0deg)")
};
});
});
非常感谢您的帮助!
解决方案
.hover()
可以带两个功能。您的语法不正确,因为您使用的是;
而不是,
.
根据 jQuery文档删除;
并替换为 a 。也替换为底部。,
});
);
我已经格式化以使其更易于阅读。
$(".menu-toggle").hover(
function() {
$("#Wrapper").css("transform", "perspective(900px) rotateY(-5deg)");
},
function() {
$("#Wrapper").css("transform", "perspective(0px) rotateY(0deg)");
}
);
推荐阅读
- javascript - ElectronJS - webcontents.on 'did-finish-load' vs 'dom-ready' vs 'ready-to-show'
- sql - 选择不同的案例计数
- swift - ARKIT scanner not building
- reactjs - React Router 在重新渲染之前显示带有旧组件/数据的动态路由
- android - 设置 BitmapFactory.options 后未绘制位图
- optimization - 在 CPLEX Studio IDE 中应用 Benders 分解
- javascript - 表单输入将重定向到文本输入
- corda - 索引 0 {} 处缺少参数名称
- java - 我的 javafx 程序中的这个语句导致了一个空指针异常,我不知道为什么
- node.js - 为什么我的 Docker 容器没有运行我的 Nodejs 应用程序?