<div style="margin:0 auto;width:300px"> <img src="http://flowplayer.org/tools/img/expose/ball_ " /> 狂野欧美激情性xxxx,最新亚洲情黄在线网站,日本高清www无色夜在

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

jquery tools系列 expose 學(xué)習(xí)

如overlay的學(xué)習(xí),首先給出操作的html目標(biāo)代碼:
復(fù)制代碼 代碼如下:
<div id="test">
    expose test!
</div>

<div style="margin:0 auto;width:300px">
    <img src="http://flowplayer.org/tools/img/expose/ball_large.png" id="ball" style="width:130px" />
</div>
<div style="position:relative;z-index:10000">
<button type="button" id="btn_open">open div</button>
<button type="button" id="btn_close">close div</button>
</div>

該功能是通過(guò)jqueryObject.expose()方法來(lái)實(shí)現(xiàn)的,其具體實(shí)現(xiàn)方式如下:
$("jquery selector").expose({config object}) //該方法通過(guò)配置對(duì)象將來(lái)定制expose的顯示。
以下代碼為配置參數(shù)說(shuō)明描述:
屬性默認(rèn)值詳細(xì)描述
color'#456'設(shè)置頁(yè)面中非expose(突出顯示)區(qū)域在expose(突出顯示)效果顯示時(shí)的背景顏色。如果此處未設(shè)置背景色,那么expose功能會(huì)提供一個(gè)默認(rèn)的顏色。另外屬性亦可通過(guò)maskId的CSS樣式來(lái)設(shè)置。
opacity0.8設(shè)置頁(yè)面中非expose(突出顯示)區(qū)域在expose(突出顯示)效果顯示時(shí)的背景透明度。該處透明度的取值范圍為[0,1],該處值越大,透明度越低。
loadSpeed'slow'設(shè)置頁(yè)面中非expose(突出顯示)區(qū)域在expose(突出顯示)效果觸發(fā)時(shí)的顯示速度。該處值可設(shè)置為:'slow','normal','fast'和毫秒數(shù)值。例如:如果此處設(shè)置值為2000,那么非expose(突出顯示)區(qū)域效果將會(huì)在2秒鐘中內(nèi)顯示完成。如果此處設(shè)置值為0,那么非expose(突出顯示)區(qū)域?qū)?huì)沒(méi)有動(dòng)畫效果并立即顯示出來(lái)。
closeSpeed'fast'設(shè)置頁(yè)面中非expose(突出顯示)區(qū)域在expose(突出顯示)效果關(guān)閉時(shí)的關(guān)閉速度。該處值可設(shè)置為:'slow','normal','fast'和毫秒數(shù)值。具體示例可參見本文相關(guān)示例。
  
maskId'exposeMask'expose(突出顯示)區(qū)域?qū)?yīng)的頁(yè)面div元素id,它是一個(gè)普通的div元素,當(dāng)expose(突出顯示)被觸發(fā)后,他會(huì)自動(dòng)調(diào)整以完全的覆蓋整個(gè)頁(yè)面。非expose(突出顯示)區(qū)域的顯示效果可以通過(guò)設(shè)置該處div的樣式來(lái)改變。如果此處沒(méi)有設(shè)置,那么該插件會(huì)默認(rèn)提供一個(gè)idexposeMaskdiv來(lái)實(shí)現(xiàn)非expose區(qū)域。
closeOnClickTRUE該屬性用于設(shè)置非expose區(qū)域被點(diǎn)擊時(shí),是否關(guān)閉expose(突出顯示)效果。該屬性默認(rèn)值為true,及非expose區(qū)域被點(diǎn)擊后,expose效果被關(guān)閉。
closeOnEscTRUE該屬性用于設(shè)置Esc鍵被按下后,是否關(guān)閉expose(突出顯示)效果。該屬性默認(rèn)值為true,及Esc鍵被按下后,expose效果被關(guān)閉。
zIndex9998設(shè)置頁(yè)面設(shè)置頁(yè)面中非expose(突出顯示)區(qū)域的z-index(CSS)屬性。一般情況下,默認(rèn)的zIndex屬性值都非常大,所以這里不需要設(shè)置,但是,有一點(diǎn)需要注意的是,該非expose(突出顯示)的z-index屬性值一定要大于頁(yè)面中任何一個(gè)元素的z-index屬性。
apiFALSE該屬性解釋可參見本系列中tabs,scollable等功能同屬性的解釋。
  
onBeforeLoad expose(突出顯示)效果觸發(fā)前調(diào)用函數(shù)。如果該函數(shù)返回false,那么expose(突出效果)將會(huì)被阻止實(shí)現(xiàn)。
onLoad expose(突出顯示)效果實(shí)現(xiàn)后,該函數(shù)被觸發(fā)。
onBeforeClose expose(突出顯示)效果關(guān)閉前調(diào)用函數(shù)。如果該函數(shù)返回false,那么expose(突出效果)將會(huì)被阻止關(guān)閉。
onClose expose(突出顯示)效果關(guān)閉后,該函數(shù)被觸發(fā)。
此外,expose還提供了一系列獲取expose對(duì)象的方法,這些方法的說(shuō)明描述如下:
方法返回值詳細(xì)描述
load()API觸發(fā)expose(突出顯示)效果,該方法只有expose(突出顯示)被初始化后才能調(diào)用成功。
close()API關(guān)閉expose(突出顯示)效果。
isLoaded()boolean判斷當(dāng)前expose(突出顯示)是否已被觸發(fā)。
getMask()jQuery返回非expose(突出顯示)jquery對(duì)象??梢酝ㄟ^(guò)jquery的相關(guān)方法來(lái)改變非expose(突出顯示)區(qū)域的顯示效果。
getExposed()jQuery返回expose(突出顯示)jquery對(duì)象。
getConf()Object返回expose(突出顯示)的配置對(duì)象。
  
onBeforeLoad(fn)API同配置文件中onBeforeLoad屬性。
onLoad(fn)API同配置文件中onLoad屬性。
onBeforeClose(fn)API同配置文件中onBeforeClose屬性。
onClose(fn)API同配置文件中onClose屬性。
對(duì)于expose配置對(duì)象屬性設(shè)置及方法調(diào)用的具體使用方法如下:
復(fù)制代碼 代碼如下:
var testApi=$("#test").expose({
            color:'#44f',
            opacity:0.5,
            loadSpeed:2000,
            closeSpeed:3000,
            closeOnClick:false,
            closeOnEsc:false,
            api: true,
            lazy:true,
            onBeforeLoad:function(){
                alert("before load!");
            },
            onLoad:function(){
                alert("onLoad!");
            },
            onBeforeClose:function(){
                alert("mask-background:"+this.getMask().css("color")+",exposeId:"+this.getExposed().attr("id")
                                    +"/n expose color:"+this.getConf().color);
                //alert("Before close!");
            },
            onClose:function(){
                alert("Close!");
            }

        });

        
    $("#test").click(function() {
        testApi.load();
    });

    $("#btn_open").click(function(){
        testApi.load();
    });
    $("#btn_close").click(function(){
        testApi.close();
    });

    alert("test is load:"+testApi.isLoaded());

    $("#ball").expose({
        //此處通過(guò)maskId中樣式的backgroundcolor來(lái)設(shè)置color屬性
        maskId:'mask',
        opacity:0.5,
        closeSpeed:'slow',
        onBeforeLoad:function(){
            this.getExposed().animate({width:298});
        },
        onBeforeClose:function(){
            this.getExposed().animate({width:130});    
        }

        }).click(function(){
        $(this).expose().load();
    });

最后,給出完整示例代碼及該功能得部分demo圖片:
復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script src="http://flowplayer.org/tools/js/tools/1.0.2/jquery.tools.min.js" ></script>
<style><!--
#test {
    border:1px solid #ccc;
    background-color:#fff;
    padding:50px;
    font-size:30px;
    margin:20px auto;
    text-align:center;
    width:600px;
}
#mask {
background:#072a88 url(http://flowplayer.org/tools/img/expose/mask_star_1600px.jpg) no-repeat scroll 50% -274px;
}
--></style><style >#test {
    border:1px solid #ccc;
    background-color:#fff;
    padding:50px;
    font-size:30px;
    margin:20px auto;
    text-align:center;
    width:600px;
}
#mask {
background:#072a88 url(http://flowplayer.org/tools/img/expose/mask_star_1600px.jpg) no-repeat scroll 50% -274px;
}</style>

<div id="test">
    expose test!
</div>

<div style="margin:0 auto;width:300px">
    <img src="http://flowplayer.org/tools/img/expose/ball_large.png" id="ball" style="width:130px" />
</div>
<div style="position:relative;z-index:10000" >
<button type="button" id="btn_open">open div</button>
<button type="button" id="btn_close">close div</button>
</div>
<script type="text/Javascript"><!--
$(function(){

    var testApi=$("#test").expose({
            color:'#44f',
            opacity:0.5,
            loadSpeed:2000,
            closeSpeed:3000,
            closeOnClick:false,
            closeOnEsc:false,
            api: true,
            lazy:true,
            onBeforeLoad:function(){
                alert("before load!");
            },
            onLoad:function(){
                alert("onLoad!");
            },
            onBeforeClose:function(){
                alert("mask-background:"+this.getMask().css("color")+",exposeId:"+this.getExposed().attr("id")
                                    +"/n expose color:"+this.getConf().color);
                //alert("Before close!");
            },
            onClose:function(){
                alert("Close!");
            }

        });

        
    $("#test").click(function() {
        testApi.load();
    });

    $("#btn_open").click(function(){
        testApi.load();
    });
    $("#btn_close").click(function(){
        testApi.close();
    });

    alert("test is load:"+testApi.isLoaded());

    $("#ball").expose({
        //此處通過(guò)maskId中樣式的backgroundcolor來(lái)設(shè)置color屬性
        maskId:'mask',
        opacity:0.5,
        closeSpeed:'slow',
        onBeforeLoad:function(){
            this.getExposed().animate({width:298});
        },
        onBeforeClose:function(){
            this.getExposed().animate({width:130});    
        }

        }).click(function(){
        $(this).expose().load();
    });

});
// --></script>

JavaScript技術(shù)jquery tools系列 expose 學(xué)習(xí),轉(zhuǎn)載需保留來(lái)源!

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

主站蜘蛛池模板: 久热爱精品视频在线观看久爱 | 欧美色就是色 | 狠狠干2015| 国产精品猎奇系列在线观看 | 国产亚洲欧美在在线人成 | 国产成人精品一区二区秒拍 | 国产一级不卡毛片 | 精品国产日韩亚洲一区二区 | 这里是九九伊人 | www.99爱| 亚洲资源在线观看 | 一区二区三区伦理高清 | 8090碰成年女人免费碰碰尤物 | 精品伊人久久久久7777人 | 国产精品四虎在线观看免费 | 91精品国产色综合久久不 | 国产91精品一区二区麻豆亚洲 | 成人精品一区二区www | 91成年人免费视频 | 色综合天天综合中文网 | 色操网| 国产色婷婷精品综合在线 | 国产一级特黄一级毛片 | 中文字幕久久综合 | 在线色综合 | 伊人色综合网 | 日韩视频精品在线 | 玖玖国产在线 | 成人午夜精品网站在线观看 | 免费大学生国产在线观看p 免费的成人a视频在线观看 | 美妇乱人伦性 | 亚洲日本欧美产综合在线 | 精品视频在线免费 | 欧美五月激情 | 亚洲小说图片 | 国产欧美在线观看精品一区二区 | 国产成人亚洲综合91精品555 | 国产精品第六页 | 亚洲第一页国产 | 福利片91| 午夜一级|