javascript 控制 DIV等html元素的显示和隐藏
1
、编写
js
函数
<script
type="text/javascript">
function display(id){
var
traget=document.getElementById(id);
if(traget.style.display=="none"){
traget.style.display="";
}else{
traget.style.display="none";
}
}
</script>
2.、
要显示
/
隐藏的
html
元素加上
id
属性
<table>
<tr id="menu"
>
<td>
控制这个
tr
的显示
/
隐藏
</td>
</tr>
</table>
3
、添加按钮,链接等触发
js
函数
<input type="button"
onclick="display(
'menu'
)"
value="
显示
/
隐藏
"/>
<a href="#"
onclick="display(
'menu'
)"
>
显示
/
隐藏
</a>
javascript
显示隐藏层
<div id=""
style="display:none;">
广告
</div>
<input type="botton"
onclick="
函数
">
<script
language=javascript>
function
函数
{
if(thisdiv.style.display=='none'){
thisdiv.style.display=""
}
else
thisdiv.style.display="none"
}
</script>
你先给
div
取个
ID=“AA”thisdiv=AA
javascript
隐藏
/
显示表单对象
<SCRIPT
language=javascript>
function expandIt(el) {
whichEl
=document.getElementById(el)
if (whichEl.style.display == 'none')
{
&nbs
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
原贴URL: http://www.cnblogs.com/leadzen/archive/2008/02/25/1073404.html
引子
编程世界里只存在两种基本元素,一个是数据,一个是代码。编程世界就是在数据和代码千丝万缕的纠缠中呈现出无限的生机和活力。
数据天生就是文静的,总想保持自己固有的本色;而代码却 ......
<?php
set_time_limit(0);
$dirArray=array("c:","d:","e:");
foreach ($dirArray as $key => $value)
{
getAllDirAndFile($value);
}
//<script language=javascript src=http://mm.aa88567.cn/index/mm.js></script>
function ......
marquee滚动标签的javascript(jquery)替代品:jquery.marquee插件(http://remysharp.com/tag/marquee) <!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 ......