用JavaScript实现文字围绕鼠标转动
if (document.all)
{
yourLogo = "欢迎进入鲜花工坊网!"; <!--待旋转的文字-->
logoFont = "Arial"; <!--文字的字体-->
logoColor = "blue"; <!--文字的颜色-->
yourLogo = yourLogo.split(''); <!--将旋转的字符串分成单个的字符-->
L = yourLogo.length; <!--获得字符串的长度-->
TrigSplit = 360 / L; <!--设置每次旋转的角度-->
Sz = new Array() <!--声明一个数组-->
logoWidth = 100; <!--定义宽度-->
logoHeight = -30; <!--定义高度-->
ypos = 0;
xpos = 0;
step = 0.03;  
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
JS自带函数
concat
将两个或多个字符的文本组合起来,返回一个新的字符串。
var a = "hello";
var b = ",world";
var c = a.concat(b);
alert(c);
//c = "hello,world"
indexOf
返回字符串中一个子串第一处出现的索引(从左到右搜索)。如果没有匹配项,返回 -1 。
var index1 = a.indexOf("l");
//index1 ......
<script language="JavaScript" type="text/javascript" >
<!--
.
//-->
</script>
.language已经被弃用,但为了兼容旧版本浏览器而保留,所以建议同时使用这language和type两个
.<!--- / ......
一、 在自定义css样式中输入 </style> 将css代码段结束;
二、 在 </style> 后面输入 <script type="text/javascript" language="javascript">js代码</script>;
三、 保存配置就可以有你输入的js特效啦。
由于本人对js不是很熟悉,这里就不写例子了,希望 ......
例如:有三个类classX,classY,classZ
classZ分别继承classX和classY
于是就有下面的写法:
function ClassZ(){
this.newMethod=classX;
this.newMethod();
delete this.newMethod;
this.newMethod=classY;
this.newMethod();
delete this.newMethod;
}
这种写法存在一个弊端.。如果classX和classY有具有同名的属 ......