1. 程式人生 > 實用技巧 >JQPlug0004:layer 開啟 type 1 彈出視訊 彈出連結

JQPlug0004:layer 開啟 type 1 彈出視訊 彈出連結

1,

        /* 設定layer背景透明 */
        .shadows{background-color: transparent !important;box-shadow: 0 0 0 rgba(0,0,0,0) !important;}

    vcr = "https://www.esun3dai.com/Test/maotai.mp4";
    vidwid = document.body.offsetWidth * 0.8 + "px";
    vidhig = document.body.offsetWidth * 0.8 * 0.55 + "px";
    layer.open({
        type: 
1, title: false, closeBtn: 1, //顯示關閉按鈕 shade: 0.7, border: 0, skin: 'shadows', // area: ['658px', '356px'], //會出現滾動條 area: vidwid, // 這樣寫area可以確保不會出現滾動條 anim: 0, scrollbar: false, //防止父頁面自動跳到頁面頂端 // 播放視訊 // content: '<div style="line-height:0;"><video id="vid1" width="100%" height="100%" controlsList="nodownload" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop" src="' + vcr + '" style="width:100%;height:100%;"></video></div>'
// 開啟連結 content: '<iframe name="IF0" id="IF0" class="IF0" src="hotdemo/zhiboImg/index.html" width="100%" height="' + vidhig + '" scrolling="no" frameborder="no" allowtransparency="yes" security="restricted" sandbox="allow-top-navigation allow-same-origin allow-forms allow-popups allow-scripts"></iframe>' });
// content 中 div標籤中 line-height:0; 可以去掉視訊底部的白邊 //去掉視訊播放工具欄中的下載全屏等功能 controlslist="nodownload nofullscreen noremoteplayback" //去掉預設視訊播放欄中的 畫中畫 功能 // $('#vid1')[0]['disablePictureInPicture'] = true; //disablePictureInPicture的屬性改為true