document.all 是ie才能识别的,firefox是不支持的,你可以改成用id来获取,如下:this is a div!改一下就ok了!建议你以后不要再用document.all了,只有ie才支持
<!doctype html><html><head><meta charset="utf-8"><title>div5px</title><style type="text/css"> div { float: left; width: 100px; height: 80px; border: 1px solid #0ff; margin-right: 5px; display: none; }</style><!--$(".btn")是找到class="btn"的信
用.hide();来隐藏 用.show();做显示就可以了.
$(document).ready(function(){ $(".A").click(function (e){ $(".B").toggle(); e.stopPropagation(); }); $(".B").click(function(e){ e.stopPropagation(); });}).click(function(){ $('.B').hide(); });
在dreamweaver最下面的属性栏设置就可以
Document.getElementById("123"); 这句错了,Document第一个字母是小写,这样的错误你写的时候编辑器应该会有提示,比如我的editplus里不正确颜色不一样 浏览的时候,不同的浏览器开发工具也会提示,比如如果你用火狐的firebug,在控制台也可以看见错误提示 另外起名字是不能用数字开头的,这个也要注意 那个显示块里写点东西再测试,没有东西也看不出显示不显示
设置div的overflow为hidden. 然后动态地改变div的高度. 同时替换下面的那个按钮图标即可.
示例html<div class="abc" style="display:none"></div><input type="button" class="but" /> 最简单的方法:<script>$(document).ready(function(e) { $(".but").click(function(e) { $(".abc").toggle(); }); });</script> toggle() 的作用就是当
你要是实现什么功能嘛!$("*") 代表界面上任何点击都会进入.点击空白处相当于遍历了整个html,当然也会进入到 if里面的条件!再看看别人怎么说的.
<!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>RunJS 演示代码</title> </head><body> <input type="button" value="ok" onclick="dp()"/> <div id='content'> hello world <