<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").hide(1000);
});
});
</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>
我想判断一下我点这个按钮的时候他是隐藏我就 show 他是显示我就 hide高手帮帮忙啊..
静静等待佳音.
不过似乎没从隐藏到显示的例子都隐藏了还怎么点呢
<!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>
<title>无标题页</title> <script type="text/javascript" src="jquery-1.4.2.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>
按照你的这个写了但是他说找不到JS文件!!! 难道
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function()
{
$("p").slideToggle("slow"); //这句改成这样就可以了
});
});
</script>
得放到JS文件里?
这个是调用什么哦 ?请赐教
<script type="text/javascript" src="/jquery/jquery.js"></script>
我的是:
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
,这段js代码改成你自己的就行了,即
<script type="text/javascript" src="/jquery/jquery.js"></script>
那么浏览器会加载这个js文件,然后继续向下解析Html代码