87,910
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.10.2/jquery-1.10.2.js"></script>
<style type="text/css">
*{ margin:0; padding:0; }
body{ font:12px/1.125 Arial, Helvetica, sans-serif; background:#fff; }
a{ color:#0a8cd2; text-decoration:none; }
a:hover{ text-decoration:underline; }
.clearfix:after{ content:"."; display:block; height:0; clear:both; visibility:hidden; }
.clearfix{ display:inline-block; }
.clearfix{ display:block; }
.clear{ clear:both; height:0; font:0/0 Arial; visibility:hidden; }
.none{ display:none }
.ell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wrap{ width:120px;margin: 80px auto; height:25px; line-height:25px; font-size:14px;}
.width{width:500px;}
</style>
</head>
<body>
<div class="wrap ell">判断是否超出宽度,如果超出宽度显示,而且鼠标经过时显示全部内容可以实现吗</div>
<script>
$('.wrap').hover(function(){
$(this).removeClass('ell');
}, function(){
$(this).addClass('ell');
});
</script>
</body>
</html>