javaScript实现背景音乐与播放声音
研究了半天,不过貌似还是只能在IE上实现,其他浏览器不支持EMBED 标签
用javascript制作超链接的背景音效οnmοuseοut="controlSound('stop','document.ailisi','2.mp3')"
播
停
if (typeof evt == 'undefined') {
evt = window.event;
}
if (evt) {
evt.returnValue = message;
}
return message;
}
onbeforeunload 事件参考地址
http://msdn.microsoft.com/en-us/ ......
以下分别是用递归和两种循环对斐波那契数列的简单实现。(结果仅供参考)
递归的模式:
function Fibonacci(num){
if(num <= 2){
return 1;
}else{
return Fibonacci(num - 1) + Fibonacci(num - 2)
}
}
var counter1 = new Counter();
Fibonacci(30);
counter1.show()
//Firefo ......
自己写的一个简易计时器,能记算代码的执行时间,还可以拿来测试代码的执行效率。
function Counter(){
this.start();
}
Counter.prototype.getTime = function(){
var time = new Date();
return time.getSeconds()*1000+time.getMilliseconds();
}
Counter.prototype.start = function(){
this. ......