課程
/前端開發(fā)
/JavaScript
/網(wǎng)頁定位導(dǎo)航特效
為神馬木有效果呢?幫忙給瞅瞅
2015-06-20
源自:網(wǎng)頁定位導(dǎo)航特效 4-5
正在回答
錯誤太多了,改了半天…………
首先你的錨點就沒寫完啊
【
<li><a href="#" class="current">1F 男裝</a></li>
<li><a href="#">2F 女裝</a></li>
<li><a href="#">3F 美妝</a></li>
<li><a href="#">4F 數(shù)碼</a></li>
<li><a href="#">5F 母嬰</a></li>
】
<li><a href="#item1" class="current">1F 男裝</a></li>
<li><a href="#item2">2F 女裝</a></li>
<li><a href="#item3">3F 美妝</a></li>
<li><a href="#item4">4F 數(shù)碼</a></li>
<li><a href="#item5">5F 母嬰</a></li>
代碼里面粗心寫錯的地方太多了,比如【var current="";】,但你后面是【current】和【currentId】混用的,這個是咋也不可能會有效果的。
類似粗心的地方還有好幾處,建議自己細(xì)心檢查一遍先。
逐夢凡 提問者
脆脆鯊oi 回復(fù) 逐夢凡 提問者
;(function($)?{??? ????$.myalerts?=?{ ????????lock:?'myAlert_lock',????? ????????srollBarWidth:?75, ????????popupId:?'myAlert_popup_container', ????????alert:?function(message,?title,?callback)?{ ????????????if(?title?==?null?)?title?=?'提醒' ????????????$.myalerts._show(title,?message,?'alert',?callback); ????????}, ????????_show:?function(title,?message,?type,?callback)?{ ????????????$.myalerts._showLock(); ????????????$.myalerts._setProperty(title,message); ????????????$.myalerts._confirmEvent(); ????????}, ????????_init:?function()?{?????????? ????????????$lock?=?$("<div?id="+$.myalerts.lock+"></div>"); ????????????$lock.css({ ????????????????background:?'#000000', ????????????????opacity:?0.5, ????????????????position:?'absolute', ????????????????top:?'0', ????????????????left:?'0', ????????????????zIndex:?99990, ????????????????width:?$(document).width(), ????????????????height:?$(document).height(), ????????????????display:?'none' ????????????});???????????????? ????????????$('body').css({ ????????????????margin:?0, ????????????????padding:?0,??????????? ????????????}).append($lock).append('<div?id="myAlert_popup_container"><dl><dt?class="title">提 醒</dt><dd?class="message"</dd><dd?class="pos-right"><input?type="button"?value="確定"?/></dd></dl></div>'); ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????$popup.css({ ????????????????left:?$(window).width()/2-$("#"+$.myalerts.popupId).outerWidth()/2, ????????????????top:?$(window).height()/2-$("#"+$.myalerts.popupId).outerHeight()/2 ????????????}); ????????????$(window).on({ ????????????????resize:?function()?{ ????????????????????$lock.css({ ????????????????????????width:?$(window).width(), ????????????????????????height:?$(document).height()?? ????????????????????}); ????????????????} ????????????}); ????????}, ????????_showLock:?function()?{ ????????????var?$lock?=?$("#"+$.myalerts.lock); ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????$lock.css({ ????????????????display:?'block', ????????????????opacity:?0.5 ????????????});???? ????????????$popup.css({ ????????????????display:?'block' ????????????});???? ????????},? ????????_setProperty:?function(title,?message)?{ ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????$popup.find('.title').html(title).end().find('.message').html(message); ????????}, ????????_confirmEvent:function()?{ ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????var?$lock?=?$("#"+$.myalerts.lock); ????????????$popup.find(":button").click(function()?{ ????????????????$popup.fadeOut(200,?function()?{ ????????????????????$popup.css({ ????????????????????????display:?'none' ????????????????????}); ????????????????}); ????????????????$lock.fadeOut(200,?function()?{ ????????????????????$lock.css({ ????????????????????????display:?'none',?????????? ????????????????????}); ????????????????}); ????????????});???????? ????????} ????}; ????$.myalerts._init(); ????myAlert?=?function(message,?title,?callback)?{ ????????$.myalerts.alert(message,?title,?callback); ????}?? })(jQuery) ;(function($)?{??? ????$.myalerts?=?{ ????????lock:?'myAlert_lock',????? ????????srollBarWidth:?75, ????????popupId:?'myAlert_popup_container', ????????alert:?function(message,?title,?callback)?{ ????????????if(?title?==?null?)?title?=?'提醒' ????????????$.myalerts._show(title,?message,?'alert',?callback); ????????}, ????????_show:?function(title,?message,?type,?callback)?{ ????????????$.myalerts._showLock(); ????????????$.myalerts._setProperty(title,message); ????????????$.myalerts._confirmEvent(); ????????}, ????????_init:?function()?{?????????? ????????????$lock?=?$("<div?id="+$.myalerts.lock+"></div>"); ????????????$lock.css({ ????????????????background:?'#000000', ????????????????opacity:?0.5, ????????????????position:?'absolute', ????????????????top:?'0', ????????????????left:?'0', ????????????????zIndex:?99990, ????????????????width:?$(document).width(), ????????????????height:?$(document).height(), ????????????????display:?'none' ????????????});???????????????? ????????????$('body').css({ ????????????????margin:?0, ????????????????padding:?0,??????????? ????????????}).append($lock).append('<div?id="myAlert_popup_container"><dl><dt?class="title">提 醒</dt><dd?class="message"</dd><dd?class="pos-right"><input?type="button"?value="確定"?/></dd></dl></div>'); ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????$popup.css({ ????????????????left:?$(window).width()/2-$("#"+$.myalerts.popupId).outerWidth()/2, ????????????????top:?$(window).height()/2-$("#"+$.myalerts.popupId).outerHeight()/2 ????????????}); ????????????$(window).on({ ????????????????resize:?function()?{ ????????????????????$lock.css({ ????????????????????????width:?$(window).width(), ????????????????????????height:?$(document).height()?? ????????????????????}); ????????????????} ????????????}); ????????}, ????????_showLock:?function()?{ ????????????var?$lock?=?$("#"+$.myalerts.lock); ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????$lock.css({ ????????????????display:?'block', ????????????????opacity:?0.5 ????????????});???? ????????????$popup.css({ ????????????????display:?'block' ????????????});???? ????????},? ????????_setProperty:?function(title,?message)?{ ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????$popup.find('.title').html(title).end().find('.message').html(message); ????????}, ????????_confirmEvent:function()?{ ????????????var?$popup?=?$("#"+$.myalerts.popupId); ????????????var?$lock?=?$("#"+$.myalerts.lock); ????????????$popup.find(":button").click(function()?{ ????????????????$popup.fadeOut(200,?function()?{ ????????????????????$popup.css({ ????????????????????????display:?'none' ????????????????????}); ????????????????}); ????????????????$lock.fadeOut(200,?function()?{ ????????????????????$lock.css({ ????????????????????????display:?'none',?????????? ????????????????????}); ????????????????}); ????????????});???????? ????????} ????}; ????$.myalerts._init(); ????myAlert?=?function(message,?title,?callback)?{ ????????$.myalerts.alert(message,?title,?callback); ????}?? })(jQuery)
舉報
本課程講解網(wǎng)頁定位導(dǎo)航特效,仿天貓版地狗購物網(wǎng),你值得擁有
3 回答木有效果+1
2 回答滾動沒有效果,而且也沒有顯示錯誤,麻煩大神幫幫忙指出(已解決)
3 回答使用js寫的為什么沒有定位導(dǎo)航的效果呢,求幫忙看看
1 回答求大神幫忙看下哪里出錯了,實現(xiàn)不了滾動效果
1 回答幫我看下為什么沒效果
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2015-06-25
錯誤太多了,改了半天…………
首先你的錨點就沒寫完啊
【
<li><a href="#" class="current">1F 男裝</a></li>
<li><a href="#">2F 女裝</a></li>
<li><a href="#">3F 美妝</a></li>
<li><a href="#">4F 數(shù)碼</a></li>
<li><a href="#">5F 母嬰</a></li>
】
【
<li><a href="#item1" class="current">1F 男裝</a></li>
<li><a href="#item2">2F 女裝</a></li>
<li><a href="#item3">3F 美妝</a></li>
<li><a href="#item4">4F 數(shù)碼</a></li>
<li><a href="#item5">5F 母嬰</a></li>
】
代碼里面粗心寫錯的地方太多了,比如【var current="";】,但你后面是【current】和【currentId】混用的,這個是咋也不可能會有效果的。
類似粗心的地方還有好幾處,建議自己細(xì)心檢查一遍先。
2015-06-20