这是 codepen 的 java procect
$(document).ready(function(){
$("ul.nav li a[href^='#']").click(function(){
$("html, body").stop().animate({
scrollTop: $($(this).attr("href")).offset().top
}, 400);
});
});
我如何制作或替换代码到桌面,以便页面转换可以通过鼠标悬停而不是单击发生?我试图用 .hover(function() 替换 .click(function() 但我担心它没有工作。解决方案是什么? 提前谢谢你
最佳答案
在 :hover
中为此编写 css 代码。语法是
(classname(.)or Id(#)followed by : symbol then hover)
示例代码如下。
.(ul.nav li a:hover)
{
//Remaing codes or funnctionlaities
}
关于jquery - Bootstrap 页面过渡鼠标悬停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45661886/