1立即在页面加载
1 2 3 4 5 6 7 8 9 10 | < div class = "container" > < div class = "row" > < div class = "col-xs-12" > < p >Box 1: Reveal Immediately</ p > < div class = "box1" > < h1 >Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</ h1 > </ div > </ div > </ div > </ div > |
1 2 3 4 5 6 7 8 9 | jQuery( function () { //Box 1: reveal immediately - on page load //NOTE: id does refer to an element id, It is used to // uniquely refer to the element to be revealed. var options1 = { id: 'box1' }; $( '.box1' ).initReveal(options1); }); |
2,指定的延迟后:设置背景颜色。
1 2 3 4 5 6 7 8 9 10 | < div class = "container" style = "background-color: #555;" > < div class = "row" > < div class = "col-xs-12" > < p >Box 2: Reveals after 3000ms delay</ p > < div class = "box2" > < h1 >Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</ h1 > </ div > </ div > </ div > </ div > |
1 2 3 4 5 6 | var options2 = { id: 'box2' , delay: 3000 , background: '#555' }; $( '.box2' ).initReveal(options2); |
3:点击事件——如。onclick
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | < div class = "container" > < div class = "row" > < div class = "col-xs-12" > < p >Box 3: Reveal on click event</ p > < div > < div class = "box3" > < h1 >Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</ h1 > </ div > </ div > < button class = "btn btn-primary btn-reveal" >Reveal!</ button > </ div > </ div > </ div > |
1 2 3 4 5 6 7 8 9 10 | var options3 = { id: 'box3' , auto: false }; var box3 = $( '.box3' ); box3.initReveal(options3); $( '.btn-reveal' ).on( 'click' , function () { box3.performReveal(options3); }); |
4:当元素卷轴到视窗
1 2 3 4 5 6 7 8 9 10 11 12 | < div class = "container" > < div class = "row" > < div class = "col-xs-12" > < p >Box 4: Reveal when element scrolls into the viewport</ p > < div > < div class = "box4" > < h1 >Lorem ipsum dolor sit amet, ne mel vero impetus voluptatibus</ h1 > </ div > </ div > </ div > </ div > </ div > |
1 2 3 4 5 6 | var options4 = { id: 'box4' , auto: false , trigger: 'on-visible' }; $( '.box4' ).initReveal(options4); |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com