作者martone (Krel)
看板Ajax
标题[问题] jQuery的js档 import问题
时间Fri Oct 24 10:43:31 2008
请问各位
$(document).ready(function(){
$("#nav-one li").hover(
function(){ $("ul", this).fadeIn("fast"); },
function() { }
);
if (document.all) {
$("#nav-one li").hoverClass ("sfHover");
}
});
$.fn.hoverClass = function(c) {
return this.each(function(){
$(this).hover(
function() { $(this).addClass(c); },
function() { $(this).removeClass(c); }
);
});
};
像这样的jQuery,将它另存为js。希望主页内码能短一点,因此想import它
如:<script type="text/javascript" src="js/xxxx.js"></script>
但却没有效果,请问是方法不对吗? 请各位指教 ^^
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.170.1.10
※ martone:转录至看板 Web_Design 10/24 10:44
1F:推 chph:用Firebug看前端页面是否真的有载入这个 js 档案 10/24 10:44
2F:→ grence:是否放在载入jQuery之後 10/24 13:38