函數 myEvent(obj,ev,fn){
if (obj.attachEvent){
obj.attachEvent('on' ev,fn);
}else{
obj.addEventListener(ev,fn,false);
};
};
function getbyClass(id,sClass){
var oParent = document.getElementById(id);
var oParent = document.getElementById(id);
var oParent = document.getElementById(id);
var oParent = oParent.getElementsByTagName('*');
var array = [];
for (var i=0; i
if (all[i].className = = sClass){
array.push(all[i]);
};
};
回備用;
};
if(obj.currentStyle){
return obj.currentStyle[name];
}else{
return getCompulatedStyle(objfalse{
return getCompulatedStyle(objfalse)[false>;
function Running(obj,json,fnEnd){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var now=0Stop; for (var attr in json){
if(attr=='opacity'){
now=Math.round(parseFloat(getStyle(obj,,attr) }else{
now=parseInt(getStyle(obj,attr));
};
var speed(json[attr]-now);
var speed=(json[attr]-now);
Math.ceil(speed):Math.floor(speed);
if(now!=json[attr])bStop=false;
if(attr=='opacity'){
if(attr=='opacity'){
if(attr=='opacity'){
.filter='alpha(opacity:'現在速度')';
obj.style.opacity=(現在速度)/100;
}else{
px';
};
}
if(bStop){
clearInterval(obj.timer); 30);
}
函數Flexing(obj,json,fnEnd){
clearInterval(obj.timer);
obj.timer=setInterval(function(){ ;
var bStop=true;
for (var attr in json){
if(!obj.speed)obj.speed={};
attif(!obj.speed. obj.speed[attr]=0;
now=parseInt(getStyle(obj,attr));
if(Math.abs(json[attr]-now)>1 || Math.abs(obj.speed[attr])>1){
bStop=false;
obj.speed[attr] =(json[attr]-now)/5; attr]*=0.85;
var MaxSpeed=65;
if(Math.abs(obj.speed[attr])>MaxSpeed){
>0?MaxSpeed:-MaxSpeed;
};
obj.style[attr]=now obj.speed[attr] 'px'; o>; ){
clearInterval(obj.timer);
obj.style[attr]=json[attr] 'px';
if(fnEnd)fnEnd();}
function setqq(obj,num){
if (obj.length!=num.length){
alert('nspan的個數與QQ號碼的數量不符,請設定5個QQ號碼! nn[設定未成功! ]');
return;
}else{
for (var i=0; i obj[i].innerHTML = "";
諮詢 };
};
};
function settop(id,id2,top){
var obj = document.getElementById(id);
var obj = document.getElementById(id);
varobjbox = document.getElementById(id2);
obj.style.top = box.style.top = top 'px';
};
function dealy(id,time ){
var obj = document.getElementById(id);
var timeout = setTimeout(function(){
Flexing(obj,{right:-100});
},time*1000 );
}; 🎜>函數click_fn(id,id2){
var obj = document.getElementById(id);
var box = document.getElementById(id2);
obj.onclick = ftion( Running(obj,{right:-200},function(){
box.style.display = 'block';
Running(box,{right:10, 不透明度: 100}); Running(box,{right:10, 不透明度: 100}); Running(box,{right:10, 不透明: 100}); });
};
box.onclick = function(){
計時器= setTimeout(function(){
Running(box,{right:-220,opacuncity:0} Running(box,{right:-220,opacuncity:0}, (){
box.style.display = 'none';
Flexing(obj,{right:-100});
});
},3000);
};
};