我得到了非常沉重的jQuery代码。一切都被预装到客户端,然后进行排序使用jQuery:显示正在执行客户端脚本时加载GIF图像
$('.acc_trigger').hide();
$('#taxonomylist ul li').each(function() {
$href = $("a", this).attr("href");
if (!$href.match(/^.*\/activity\/.*[a-z,A-Z]$/i)) {
$(this).hide();
}
});
$('#taxonomylist ul li a').click(function() {
$href = $(this).attr("href");
$('.acc_trigger').hide();
$regex = new RegExp("^" + $href + "+$");
$('div.taxonomy ul li').each(function() {
$href_taxonomy = $("a", this).attr("href");
if ($href_taxonomy == $href) {
$(this).parents().filter('.views-field-webform-form-body').prev().show();
}
});
$('#taxonomylist ul li').each(function() {
$href_sub = $("a", this).attr("href");
if (!$href_sub.match($regex)) {
$(this).show();
}
});
return false;
});
如何显示加载图片时,我的JavaScript代码的工作?或者,也许你看到我的代码中可以改进的东西?
你也可以对jQuery插件blockUI它可以阻止你的用户界面的全部或部分,并显示加载图像的样子 – Fender 2011-02-04 09:33:15