建議樓主改一下主體結(jié)構(gòu) 一級菜單 二級菜單 二級菜單 一級菜單 二級菜單 二級菜單 把一級菜單的li設(shè)置為相對定位,把二級菜單的ul設(shè)置為絕對定位并隱藏,然后在js中寫 $("#menuli").hover(function(){ $(this).find("ul").show(); },function()
創(chuàng)新互聯(lián)建站從2013年開始,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目成都網(wǎng)站設(shè)計、成都網(wǎng)站制作網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元化隆做網(wǎng)站,已為上家服務(wù),為化隆各地企業(yè)和個人服務(wù),聯(lián)系電話:18980820575
JQ中沒有封裝這個方法? 你可以用animate 控制 left 或者? right 的值? 先定位position: absolute;
$("#divQQbox").toggle(
function(){
$(this).animate({left:0},300);????
},
function(){
$(this).animate({left:-472},300);
}
)
div?id="divQQbox"?class="QQbox"
/div
.QQbox{width:550px;height:1200px;background:url(aa_02.png)?repeat-y}
.QQbox?{
z-index:99;
width:?550px;
left:?-472px;
position:?absolute;
}
這是我以前的一個 左邊伸縮效果? 你自己擴展吧? 注意引入JQ庫
網(wǎng)上搜導(dǎo)航特效,有你要的效果,引入就可以,自己寫相對麻煩
CSS版本:
input{width:200px;border:1px?solid?#ddd;}
input:focus{width:300px;border-color:#c30;}
Jquery版本:
$("input").focus(function(){????
$("input").animate({"width":?300},?400);
});
$("input").blur(function(){
$("input").animate({"width":?200},?400);
});
可以使用JQ的slideToggle()函數(shù)
比如加號的對應(yīng)的類名是add;下面菜單父元素對應(yīng)的類名是meau;則可
$(".add").click(function(){
$(".meau").sildeToggle():
});
這樣試試
$(".father").toggle(function () {
$(this).removeClass("father");
$(this).addClass("father_sel2");
// $(".father_sel2").show('1000');
$(this).children('ul').slideDown('1000');
}, function () {
$(this).children('ul').slideUp('1000');
$(this).removeClass("father_sel2");
$(this).addClass("father");
});
當(dāng)前題目:jquery伸縮,jquery收起展開效果
本文來源:http://chinadenli.net/article26/dsdsgcg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、品牌網(wǎng)站建設(shè)、自適應(yīng)網(wǎng)站、Google、網(wǎng)站設(shè)計、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)