這段需放在,路徑:擴充>html自訂語法區塊



 

 

彈跳視窗文字內容


<div id="pop-welcome-content" style="display:none;">
<h2>
Hello! 彈跳視窗</h2>
</div>
<script>
setTimeout(function(){
$.fancybox.open({
src : '#pop-welcome-content',
type : 'inline'
});
}, 1000);
</script>

 

*紅字部分放入,需彈跳的內容。


------------------------------------------------------------------------------

彈跳視窗滿版圖片連結

<style type="text/css">

  #pop-welcome-content{padding:0}

  /*去除圖片連結框線*/

  #pop-welcome-content a:focus{outline:none}

</style>

<div id="pop-welcome-content" style="display:none;"><a href="連結放這邊"><img onerror="imgError(this);" src="圖片連結放這邊" /></a></div>

<script>

setTimeout(function(){

$.fancybox.open({

src : '#pop-welcome-content',

type : 'inline'

});

}, 1000);

</script>


*紅字部分放入,需圖片連結。


---------------------------------------------------------------------------------------------------------------------------------------------------------------------

彈跳視窗其他應用:


未滿18歲警告視窗

可貼在需要的頁面裡


<div id="pop-welcome-content" style="display:none;">

  <h2>請注意 未滿18歲,不能購買!</h2>

  <a class="button" href="/">離開</a>

  <a class="button" data-fancybox-close href="javascript:;">我已滿18歲</a>

</div>

<style type="text/css">

  .fancybox-close-small {

    display:none;

  }

</style>

<script>

setTimeout(function(){

$.fancybox.open({

src : '#pop-welcome-content',

type : 'inline'

});

}, 1000);

</script>