我有一个 wordpress 网站,那里有菜单。我想要的是,当一些身体悬停在 SITE 徽标上时,它会显示下拉菜单....我想要做的是始终打开,不仅在我点击时。它必须在页面刷新时加载,
任何机构都可以告诉如何做到这一点?
用于$(document).ready(function() {}
在页面加载后运行代码。然后,您可以使用 JQuery delay() 函数等待 3 秒,然后再调用菜单对象上的 slideDown。像这样的东西会起作用:
$(document).ready(function() {
$('#yourMenuID').delay(3000).slideDown(300);
}
文档 - http://api.jquery.com/ready/
文档:http ://api.jquery.com/css/
//only execute when the document returns ready
//this can be trivial if your putting the code at the footer
//you may wish to use a self invoking function in that case
$(document).ready(function(){
setTimeout(function(){
//do something
$('#somethingcool').css('background-color', 'red');
//3 seconds = 3000ms
}, 3000);
});