遮罩层Mask

可任意添加多个遮罩层,需要为触发元素添加data-open="mask"属性,并用data-src="#"属性来绑定遮罩层内容,遮罩层内添加data-close="mask"属性的元素会触发关闭

Need to get some protection for your new smartphone or tablet? How about a speaker to help pump up the jams? Google electronics department has the products you need for yourself or for your loved ones! Find fun, protective cases and covers for your iPhone, iPad, or Samsung device. If you love music be sure to check out our great headphones. Listen to your tunes while you study, work, or travel on the bus to school or work. If you are having a barbecue or other gathering you can share the music with our fantastic speakers. They come in a number of great shapes, and you can get a Bluetooth or one that plugs into your phone or tablet. All of our electronics can be purchased with great designs, photos, artwork, or text, created by our designer community. With thousands of designs to choose from you’ll be sure to find one that fits the occasion you are shopping for.

Panel Default

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Click Button:
<button type="button" data-open="mask" data-src="text" class="btn">Text</button>
<button type="button" data-open="mask" data-src="panel" class="btn">Panel</button>
<button type="button" data-open="mask" data-src="loading" class="btn">Loading</button>

Text:
<div id="text" class="mask">
    <div class="content">
        <p class="c-fff">Content</p>
        <button type="button" data-close="mask" class="btn">Close</button>
    </div>
    <i data-close="mask" class="flaticon-cross89"></i>
</div>

Panel:
<div id="panel" class="mask">
    <div class="content">
        <div class="panel box50 box-m75 box-s100 fc">
            <div class="title">Panel Default</div>
            <div class="content">
                <p>Content</p>
                <div class="tc"><button type="button" data-close="mask" class="btn">Close</button></div>
            </div>
        </div>
    </div>
    <i data-close="mask" class="flaticon-cross89"></i>
</div>

Loading:
<div id="loading" class="mask">
    <div class="content">
        <div class="loading inverse">
            <div class="bounce1"></div>
            <div class="bounce2"></div>
            <div class="bounce3"></div>
        </div>
    </div>
    <i data-close="mask" class="flaticon-cross89"></i>
</div>

局部Partial

为内容层添加class="top"转换为顶部模式,添加class="bottom"转换为底部模式

Need to get some protection for your new smartphone or tablet? How about a speaker to help pump up the jams? Google electronics department has the products you need for yourself or for your loved ones! Find fun, protective cases and covers for your iPhone, iPad, or Samsung device. If you love music be sure to check out our great headphones. Listen to your tunes while you study, work, or travel on the bus to school or work. If you are having a barbecue or other gathering you can share the music with our fantastic speakers. They come in a number of great shapes, and you can get a Bluetooth or one that plugs into your phone or tablet. All of our electronics can be purchased with great designs, photos, artwork, or text, created by our designer community. With thousands of designs to choose from you’ll be sure to find one that fits the occasion you are shopping for.

Need to get some protection for your new smartphone or tablet? How about a speaker to help pump up the jams? Google electronics department has the products you need for yourself or for your loved ones! Find fun, protective cases and covers for your iPhone, iPad, or Samsung device. If you love music be sure to check out our great headphones. Listen to your tunes while you study, work, or travel on the bus to school or work. If you are having a barbecue or other gathering you can share the music with our fantastic speakers. They come in a number of great shapes, and you can get a Bluetooth or one that plugs into your phone or tablet. All of our electronics can be purchased with great designs, photos, artwork, or text, created by our designer community. With thousands of designs to choose from you’ll be sure to find one that fits the occasion you are shopping for.

Click Button:
<button type="button" data-open="mask" data-src="text2" class="btn">Top</button>
<button type="button" data-open="mask" data-src="text3" class="btn">Bottom</button>

Top:
<div id="text2" class="mask top">
    <div class="content">
        <p class="c-fff">Content</p>
        <button type="button" data-close="mask" class="btn">Close</button>
    </div>
    <i data-close="mask" class="flaticon-cross89"></i>
</div>

bottom:
<div id="text3" class="mask bottom">
    <div class="content">
        <p class="c-fff">Content</p>
        <button type="button" data-close="mask" class="btn">Close</button>
    </div>
    <i data-close="mask" class="flaticon-cross89"></i>
</div>

事件Event

触发遮罩层的打开或关闭事件

打开遮罩层

$(function(){
    $("#element").mask("open");
});

关闭遮罩层

$(function(){
    $("#element").mask("close");
});