以及觸發(fā)動(dòng)作過(guò)快會(huì)導(dǎo)致每一個(gè)li遞增兩次到三次的情況,這個(gè)原因跟類(lèi)(Action.js)本身無(wú)關(guān).原因來(lái)源于example2.html中的演示代碼. 目前正在 " /> 日本欧美午夜三级,一级毛片全部免,56prom在线精品国产

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

用Javascript做flash做的事..才完成的一個(gè)類(lèi).Auntion Action var 0.1

請(qǐng)注意example2.html 在firefox下效果沒(méi)有在ie下圓潤(rùn),其原因來(lái)源于兼容性.

以及觸發(fā)動(dòng)作過(guò)快會(huì)導(dǎo)致每一個(gè)li遞增兩次到三次的情況,這個(gè)原因跟類(lèi)(Action.js)本身無(wú)關(guān).原因來(lái)源于example2.html中的演示代碼.
目前正在極力修改中.
咨詢(xún)改版升級(jí)信息請(qǐng)關(guān)注 我的blog
http://auntion.blogbus.com
或者加我QQ詢(xún)問(wèn):82874972
action.js
復(fù)制代碼 代碼如下:
/*
*

效果類(lèi)

By Auntion

QQ:82874972

Blog:[email protected]

Email:[email protected]

版權(quán)沒(méi)有,隨便使用.

使用時(shí)請(qǐng)勿刪除此部分注釋.謝謝!

*
*/


ShowHide = Class.create();ShowHide.prototype = {status: expRs={},initialize: function(ob,endW,endH,effect,step){this.element=(typeof(ob)=='object') ? ob : $id(ob);if(expRs[ob.id]==null){ expRs[ob.id] = true; }if(expRs[ob.id]){this.width=this.element.offsetWidth;this.height=this.element.offsetHeight;this.endW=(endW != null)?endW.isZero():null;this.endH=(endH != null) ? endH.isZero():null;this.effect=(effect!=null)?effect:0;this.step=(step!=null)?step:0.075;this.now=[0,0];this.tryBug=this.step;this.method,this.goTo;expRs[this.element.id]=false;this.start();}},start: function(){switch(this.effect){case 0:{var method = this.judgment();this.base(method);}break;case 1:{var method = this.judgment();this.alpha(method);}break;default:{alert("錯(cuò)誤: 不是一個(gè)可用的效果! 應(yīng)為0和1,默認(rèn)執(zhí)行0");var method = this.judgment();this.base(method);}}},base: function(method){this.element.style.overflow = "hidden";this.goTo = this.create(method);},alpha: function(method,step,Opacity){alert("未完成的效果,自動(dòng)用默認(rèn)效果替代.");this.goTo = this.base(method);},allIs: function(){this.now[0] += this.expressions(0,this.endW,this.now[0],this.step);this.now[1] += this.expressions(0,this.endH,this.now[1],this.step);if((this.width > this.endW) ? (this.now[0] > (this.endW+this.tryBug)) : (this.now[0] < (this.endW-this.tryBug))){this.element.style.width = this.now[0]+"px";}if((this.height > this.endH)? (this.now[1] > (this.endH+this.tryBug)) : (this.now[1] < (this.endH-this.tryBug))){this.element.style.height= this.now[1]+"px";}else{clearInterval(this.goTo);this.element.style.width = (this.now[0]+this.tryBug)+"px";this.element.style.height= (this.now[1]+this.tryBug)+"px";expRs[this.element.id] = true;}},widthIs: function(){this.now += this.expressions(0,this.endW,this.now,this.step);if((this.width > this.endW) ? (this.now > (this.endW+this.tryBug)) : (this.now < (this.endW-this.tryBug))){this.element.style.width = this.now+"px";}else{clearInterval(this.goTo);this.element.style.width = (this.now+this.tryBug)+"px";expRs[this.element.id] = true;}},heightIs: function(){this.now += this.expressions(0,this.endH,this.now,this.step);if((this.height > this.endH) ? (this.now > (this.endH+this.tryBug)) : (this.now < (this.endH-this.tryBug))){this.element.style.height = this.now+"px";}else{clearInterval(this.goTo);this.element.style.height = (this.now+this.tryBug)+"px";expRs[this.element.id] = true;}},judgment: function(){if(this.endW != null && this.endH !=null){this.method = "all";this.now = [this.width,this.height];}else if(this.endW != null && this.endH == null){this.method = "width";this.now = this.width;}else if(this.endW == null && this.endH != null){this.method = "height";this.now = this.height;    }return this.method;},create: function(codeString){var ShowHideGoTo;switch(codeString){case "all" : ShowHideGoTo = setInterval(function(){this.allIs();}.bind(this),1);break;    case "width" : ShowHideGoTo = setInterval(function(){this.widthIs();}.bind(this),1);break;case "height": ShowHideGoTo = setInterval(function(){this.heightIs();}.bind(this),1);break;}return ShowHideGoTo;},expressions: function(num,end,now,step){var exec;switch(num){    case 0 : exec = (end - now)*step;break;            default : exec = (end - now)*step;break;}return exec;}};

language.js
復(fù)制代碼 代碼如下:
/*
*
語(yǔ)言擴(kuò)展包

By Auntion

QQ:82874972

Blog:[email protected]

Email:[email protected]

版權(quán)沒(méi)有,隨便使用.

使用時(shí)請(qǐng)勿刪除此部分注釋.謝謝!

*
*/



var Class={create: function() {return function() {this.initialize.apply(this, arguments);}}};$id = function(i){return document.getElementById(i);};$name = function(i){return document.getElementsByName(i);};$class = function(className,baseId) {var fatherId = null;if(!baseId){fatherId = document;}else{var id = baseId;fatherId = $id(id);}var basic = fatherId.getElementsByTagName('*') || document.all;var child = null;var classNames = null;var aggregate = []; for (var i = 0; i < basic.length; i++) {child = basic[i];classNames = child.className.split(' ');for (var j = 0; j < classNames.length; j++) {if (classNames[j] == className) {aggregate.push(child);break;}}}return aggregate;};String.prototype.toInt = function(){return parseInt(this.replace(/[a-zA-Z]+/,''));};Number.prototype.isZero = function(){return (this < 0) ? 0 : this;};Function.prototype.bind = function(e) {var md = this;return function(){return md.apply(e,arguments);}};Object.prototype.attachEvent=function(method,func){if(!this[method]) this[method]=func;else this[method]=this[method].attach(func);};Function.prototype.attach=function(func){var f=this;return function(){f();func();}};

example.html
復(fù)制代碼 代碼如下:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>example1</title>
<script src="Language.js" language="Javascript"></script>
<script src="Action.js" language="Javascript"></script>
<style type="text/css">

*,body{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
}

#main {
    margin:50px;
    padding:0px 0px 20px 0px;
    border:solid 1px #cccccc
}

#button {
    color:#0099FF;
}

#button li{
    margin-right:10px;
    padding:5px 0 0 0;
    width:104px;
    height:22px;
    border: solid 1px #cccccc;
    background-color: #eeeeee;
    float:left;
    text-align:center;
}

#demo{
    margin-top:20px;
    background-color:#CCCCCC;
    color:#f5f5f5;
    float:inherit;
    /*border:solid 1px #aaaaaa;*/
}

</style>
</head>
<body>

    <table border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>
    <div id="button">
        <ul>
            <li id="a">恢復(fù)初始值</li>
            <li id="b">隱藏</li>
            <li id="c">寬 + 30</li>
            <li id="d">高 + 30</li>
            <li id="e">寬 - 30</li>
            <li id="f">高 - 30</li>
            <li id="i">寬600,高100</li>
        </ul>

    </div>
            </td>
          </tr>
</table>

    <table border="0" align="center" cellpadding="0" cellspacing="0">
      <tr><td align="center" valign="middle">
        <div id="demo" style="height:200px;width:200px;"></div>
  </td></tr></table>

<script language="Javascript" type="text/Javascript">
var element = $id("demo");

var width = element.offsetWidth;
var height= element.offsetHeight;

alert(width)

var step = 0.115

function now(){
    this.nowWidth = element.style.width.toInt();
    this.nowHeight= element.style.height.toInt();
}

    $id("a").onmousedown = function(){

        new ShowHide(element,width,height,0,step);

    }

    $id("b").onmousedown = function(){

        new ShowHide(element,0,0,0,step);

    }

    $id("c").onmousedown = function(){

        var test = new now();
        new ShowHide(element,test.nowWidth+30,null,0,step);

    }

    $id("d").onmousedown = function(){

        var test = new now();
        new ShowHide(element,null,test.nowHeight+30,0,step);

    }

    $id("e").onmousedown = function(){

        var test = new now();
        new ShowHide(element,test.nowWidth-30,null,0,step);

    }

    $id("f").onmousedown = function(){

        var test = new now();
        new ShowHide(element,null,test.nowHeight-30,0,step);

    }

    $id("i").onmousedown = function(){

        new ShowHide(element,600,100,0,step)

    }
</script>
</body>
</html>

JavaScript技術(shù)用Javascript做flash做的事..才完成的一個(gè)類(lèi).Auntion Action var 0.1,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 在线国产视频观看 | 国产精品美女WWW爽爽爽视频 | 无码乱人伦一区二区亚洲一 | 成 人 免费 黄 色 网站无毒下载 | 精品国产中文字幕在线视频 | 快穿之诱受双性被灌满h | a久久99精品久久久久久蜜芽 | 人妻体体内射精一区二区 | 成人免费视频网站www | 精品无码日本蜜桃麻豆 | 国内精品久久久久影院男同志 | 欧美牲交视频免费观看K8经典 | 性XXXXX搡XXXXX搡景甜 | 欧美 亚洲 日韩 在线综合 | 久久99这里只有精品 | 三八成人网 | 原神美女被超污app 御姐被吸奶 | 国内精品国内自产视频 | 99久久免费看国产精品 | 久草在线在线精品观看 | 玩弄放荡人妻一区二区三区 | 3a丝袜论坛| 国产精品嫩草99AV在线 | 色噜噜视频影院 | 我年轻漂亮的继坶2中字在线播放 | 亚洲精品久久久久一区二区三 | 野花日本完整版在线观看免费高清 | 国产亚洲一区二区三区啪 | 亚洲精品久久久久一区二区三 | 蜜臀AV熟女人妻中文字幕 | 日本全彩黄漫无遮挡 | 国产精品18久久久久久白浆. | 国产午夜a理论毛片在线影院 | 黑人开嫩苞 | 男人和女人一级黄色大片 | 亚洲区视频在线观看 | 一二三四在线观看高清电视剧 | 美女被C污黄网站免费观看 美女白虎穴 | 久久re视频这里精品免费1 | 啊…嗯啊好深男男高h文总受 | 国产亚洲精品成人a在线 |