用javascript动态设置css样式的值
css控制位置:
纯数字
el.style.posLeft = 0;
el.style.posTop = 0;
数字+单位
el.style.left = "0px";
el.style.top = "0px";
css控制元素的样式:
document.getElementById("para").style.fontWeight ="bold";
或(其他也是这样):
document.getElementById("para").className ="strong";
相关文档:
The ExternalInterface API
之前我们使用flash调用javascript函数,一般使用这样的方法:
代码:
getURL(“javascript:alert(‘hello zhang-chao.com’);”); //注意字符串 双引号 里面加单引号
但是使用这种方法从flash调用javascript函数仍存在许多困难 ......
visibility: hidden, visible
display: block, inline, none
visibility: 控制页面元素的显示和隐藏,不空值元素的位置特征。
document.getElementById("div").style.visibility = "hidden"; //隐藏元素
document.getElementById("div").style.visibility = "visible"; //显示元素
当元素在页面是隐藏时, ......
function sAlert(msg,boxtype,func,msgtitle)
sAlert('信息内容',1,'','信息标题')
@msg:提示信息内容
@boxtype:1为弹出框,2为确认框,3为提示框
@func:点确认时执行的函数
@title:信息框标题文字内容
只有msg是必须的,后面的参数可以省略。如果中间的参数为空则在对应位置上''或者 ......
1.一行三列
<!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" lang="gb2312">
<head><title>css布局:一行三列</title>
<link rel="stylesheet" href ......