<html>
<head>
<title>无标题页</title>
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("button").click(function () {
$("p").slideToggle("slow");
});
});
</script>
</head>
<body>
<button type="button">Hide</button>
<p>
This is a paragraph with little content.</p>
<p>
This is another small paragraph.</p>
</body>
</html>我要写一个什么 方法能<p>LODE的时候就隐藏呢?
如果P不隐藏的话我这方法跟吗写一样 - - 请高手解决一下
<head>
<title>无标题页</title>
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("button").click(function () {
$("p").slideToggle("slow");
});
});
</script>
</head>
<body>
<button type="button">Hide</button>
<p>
This is a paragraph with little content.</p>
<p>
This is another small paragraph.</p>
</body>
</html>我要写一个什么 方法能<p>LODE的时候就隐藏呢?
如果P不隐藏的话我这方法跟吗写一样 - - 请高手解决一下
<head>
<title>无标题页</title>
<script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("p").hide(); $("button").click(function() {
$("p").show().slideToggle("slow");
});
});
</script>
</head>
<body>
<button type="button">Hide</button>
<p>
This is a paragraph with little content.</p>
<p>
This is another small paragraph.</p>
</body>
</html>
This is a paragraph with little content.</p>隐藏起来当我点按钮的时候在显示(如果再点就在隐藏)
<html>
<head>
<title>无标题页</title> <script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('p').hide();
$("button").click(function() {
$("p").slideToggle("slow");
});
});
</script>
</head>
<body>
<button type="button">Hide</button>
<p>
This is a paragraph with little content.</p>
<p>
This is another small paragraph.</p>
</body>
</html>
我还以为要什么啊。。slideToggle就是如果元素隐藏就显示反之也一样那你就把P元素在初始设成一个display:none;就行了5楼是一种但下面这样写就行。。
<html>
<head>
<title>无标题页</title> <script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("button").click(function() {
$("p").slideToggle("slow");
});
});
</script>
</head>
<body>
<button type="button">Hide</button>
<p style="display:none">
This is a paragraph with little content.</p>
<p style="display:none">
This is another small paragraph.</p>
</body>
</html>