为了账号安全,请及时绑定邮箱和手机立即绑定

导航条菜单的制作

江老实 Web前端工程师
难度初级
时长23分
学习人数
综合评分9.53
1004人评价 查看评价
9.8 内容实用
9.4 简洁易懂
9.4 逻辑清晰
$(document).ready(function(){
$('li').hover(function(){
$(this).children().css('overflow','visible');
},function(){
$(this).children().css('overflow','hidden');
})
})
有背景图片的大佬发给我呗
.nav li a{ display:block;text-indent:20px;height:40px; line-height:40px; width:100px; background-color:#efefef; margin-bottom:2px;}

已采纳回答 / 谷果果
你在set进去宽度那里没有清除之前的操作,或者你的浏览器看看支不支持这个方法

最新回答 / 三生草
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-...

最新回答 / data_man7
用 jquery是“ <script>                                ......                               $("a").stop().animate({“width”:"160px"},200);                               ......                      </script>”
空格用&amp;nbsp;累死你,直接用&amp;emsp;就行了

最新回答 / qq_fzjiwillbegy_0
a:hover{ color:#fff;background-position:0 -30px;}背景图片要下移,不然color看不到
老师讲解的很独特,很到位。
龚小样是对的,孤月王珏的话别听啊,不知道是谁自作聪明呢
aLi[i].onmouseover=function(){
var that = this.getElementsByClassName(&quot;subNav&quot;)[0];
var addHeight = 0;
var addEvt = setInterval(function(){
addHeight += 30;
if(addHeight &gt; 120){ clearInterval(addEvt); };
that.style.height = addHeight + &quot;px&quot;;
}, 20);
}
aLi[i].onmouseover=function(){

var that = this.getElementsByClassName(&quot;subNav&quot;)[0];
var addHeight = 0;
var addEvt = setInterval(function(){
addHeight += 30;
if(addHeight &gt; 120){ clearInterval(addEvt); };
that.style.height = addHeight + &quot;px&quot;; }, 20);
}
爱楼来,哈哈哈

最新回答 / ASuYongZhi
<style type="text/css">*{margin:0; padding:0; font-size:14px;}ul{ list-style:none;}a{color:#333;text-decoration:none}.nav li{    float:left;    border-top:1px solid #000;}.nav li a{ display:block; text-indent:20px; height:30px; line-height:30px; wid...

最赞回答 / 阡陌旧时光
连在一起是因为少了一行代码,在“a”标签里添加一行width :100px;就好了
课程须知
1.熟悉html知识,尤其对<ul>和<a>比较熟悉; 2.对css样式比较了解; 3.掌握JavaScript和jQuery基础知识。
老师告诉你能学到什么?
轻松制作出各种形式的网站导航条菜单

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消