Loại code bật thêm 1 cửa số mới


Bạn chỉ cần coppy JavaScript và thay đổi dòng bôi đỏ bằng trang bạn muốn bật lên thôi là OK
Còn số 2 là cửa sổ bật lên (bạn nên để 1 hoặc 2 để tránh gây khó chịu cho người đọc )
<script>
// Dirty Popup

// Author: Tuandv33
// http://tienichvietnam.blogspot.com

//////////////////////////////////////////////////////////////////
// CONFIGURATION STARTS HERE
//////////////////////////////////////////////////////////////////

// the URL of the webpage that will be displayed in the popupwindow
var popupurl="http://tienichvietnam.blogspot.com"

// the width of the popup-window (pixels)
var popupwidth=180

// the height of the popup-window (pixels)
var popupheight=120

// Configure here how many popups shall appear before the script stops
// creating new ones
// ATTENTION: a high number might crash the PC of your visitors
var maximumpopups=2

//////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
//////////////////////////////////////////////////////////////////

// do not edit the code below this line
var countpopups=0
var ns6=document.getElementById&&!document.all?1:0
var ie=document.all?1:0

function startpopup() {
    if (ns6 || ie) {
        countpopups=0
        var popuptop=Math.floor(400*Math.random()) 
        var popupleft=Math.floor(600*Math.random())
        window.open(popupurl, "", "toolbar=no,width="+popupwidth+",height="+popupheight+",top="+popuptop+",left="+popupleft+"");
    }
}

function openpopup() {
    if (countpopups<maximumpopups && (ns6 || ie)) {
        for (i=0;i<=1;i++) {
            var popuptop=Math.floor(400*Math.random())
            var popupleft=Math.floor(600*Math.random())
                    window.open(popupurl, "", "toolbar=no,width="+popupwidth+",height="+popupheight+",top="+popuptop+",left="+popupleft+"");
            countpopups++
        }
    }
}
window.onload=startpopup
</script>
Related posts:

Đăng nhận xét

Mới hơn Cũ hơn

Discuss

×Close