jQuery load()不起作用
jQuery load() doesn't work
我的问题与加载事件是,当我测试页面它不工作(不隐藏预加载器图像),但当我把函数在.ready(),该函数工作(它隐藏)。
下面是代码: JAVASCRIPT:$(document).load(function(){
$("#loaderHolder").hide("fast");
});
$(document).ready(function(){
$('#slider').cycle();
$('.sf-menu').superfish({
autoArrows: false
});
$('.scroll').slimScroll({
height: '590px',
wheelStep:5,
size:'15px',
width:'590px',
position: 'left',
railColor:'#c5c5c5',
color:'#a2a1a1',
railVisible:true,
alwaysVisible:true,
distance: '565px'
});
$('.scroll').css('width','550px');
$('.gallery').colorbox();
$('#gallery img').hover(function(){ $(this).fadeTo(500, 0.3)}, function(){$(this).stop().fadeTo(500, 1)})
$("#home-link").click(function(){
if ($(".active").length == 0)
{
return ;
}
else
{
var active = $(".active");
active.css("display","inline-block");
active.hide("slide",{},700);
active.attr("class","vanished");
}
});
$("#about-link").click(function(){
if ($(".active").length == 0)
{
var hidden = $("#about");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
else
{
if ($("#about").attr("class") == "active")
{
return ;
}
else
{
var active = $(".active");
active.css("display","inline-block");
active.hide("slide",{},700);
active.attr("class","vanished");
var hidden = $("#about");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
}
})
$("#starters-link").click(function(){
if ($(".active").length == 0)
{
var hidden = $("#starters");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
else
{
if ($("#starters").attr("class") == "active")
{
return ;
}
else
{
var active = $(".active");
active.css("display","inline-block");
active.hide("slide",{},700);
active.attr("class","vanished");
var hidden = $("#starters");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
}
})
$("#gallery-link").click(function(){
if ($(".active").length == 0)
{
var hidden = $("#gallery");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
else
{
if ($("#gallery").attr("class") == "active")
{
return ;
}
else
{
var active = $(".active");
active.css("display","inline-block");
active.hide("slide",{},700);
active.attr("class","vanished");
var hidden = $("#gallery");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
}
})
$("#contacts-link").click(function(){
if ($(".active").length == 0)
{
var hidden = $("#contacts");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
else
{
if ($("#contacts").attr("class") == "active")
{
return ;
}
else
{
var active = $(".active");
active.css("display","inline-block");
active.hide("slide",{},700);
active.attr("class","vanished");
var hidden = $("#contacts");
hidden.show("slide",{},700);
hidden.attr("class","active");
}
}
})
});
尝试(窗口)美元.load()不(文档)美元.load ()
$(window).load(function () {
// run code
});
尝试:
$(window).load
代替
$(document).load
我认为$。load是对给定url(第一个参数)实际执行AJAX请求的方法。如果你想在文档上做点什么。加载事件必须使用$(document).ready()
相关文章:
- jQuery css可见性在load方法中不起作用
- for循环中的jquery.load()不起作用
- 使用 jQuery .load() 加载的内容不起作用
- Ajax load在chrome中不起作用,而在Fire fox中工作
- JQuery '.load()' 不起作用
- Jquery .load() 函数在 Chrome 上不起作用
- 为什么我的 jquery .load() 函数不起作用
- Windows.load 函数在 IE 浏览器中不起作用
- CSS :悬停在 jquery load();之后不起作用
- jquery load 函数在我的代码上不起作用.这是为什么
- JS不起作用,即使在使用window.load之后也是如此
- JQuery .load() 函数不起作用
- Jquery (ajax) load function 不起作用
- ChartJS在jquery.load()(AJAX)加载的.php中不起作用
- $.load()链接不起作用
- jQuery load()函数不起作用
- $(“#myElement”).load(url)在插入到表行时不起作用
- jQuery load()方法不起作用
- Javascript在使用.load()加载的DIV中不起作用
- 如果页面有重定向,window.load将不起作用