[問題] jQuery的js檔 import問題
請問各位
$(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
推
10/24 10:44, , 1F
10/24 10:44, 1F
→
10/24 13:38, , 2F
10/24 13:38, 2F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章