width: "toggle" 是什么意思?
width: "toggle" 是什么意思?
width: "toggle" 是什么意思?
2016-11-23
toggle是一个方法。具体看这个链接: http://www.imooc.com/code/10169 .通过改变CSS的display属性,匹配的元素将被显示或隐藏。
最好的办法就是自己试试
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script>
<style>
div {position: absolute;width: 100px; height: 100px; background: green;}
</style>
</head>
<body>
<input type="button" value="toggle"/>
<div></div>
<script>
$("input").click(function () {
$("div").animate({
width: "toggle"
})
})
</script>
</form>
</body>举报