Tuesday, May 17, 2016

5 popup website quảng cáo thường dùng cho website - Blogspot tốt nhất


popup website quảng cáo thường dùng cho website - Blogspot Giúp chúng ta quảng cáo một sự kiện hoặc một trang web.
Tổng hợp các Popup - Javascripts quảng cáo cho website - Blogspot

Các loại Popup mình sẽ chia sẻ trong bài viết này

Popup xuất hiện nhiều tab mỗi khi click chuột
Popup-under hiện sau trình duyệt cho website/Blogger
popup mở ra tab mới khi click vào vị trí bất kỳ trên web
mở popup cửa sổ quảng cáo nhỏ dưới góc màn hình
Popup: Xuất hiện popup khi click chuột lần đầu tiên
Popup : Xuất hiện nhiều cửa sổ khi click lần đầu tiên
tạo quảng cáo popup xuất hiện 1 lần/1 ngày/1 ip



Tùy vào mục đích sử dụng các bạn sử dụng phù hợp nhé


1. tạo quảng cáo popup xuất hiện 1 lần/1 ngày/1 ip
Tìm đến thẻ <body> và thay thế thành như bên dưới




<script>
//<![ATA[
function Set_Cookie(name, value, expires, path, domain, secure) {
var today = new Date();
today.setTime(today.getTime());
var expires_date = new Date(today.getTime() + (expires));

document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}

function Get_Cookie(name) {

var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
if ((!start) &&
(name != document.cookie.substring(0, name.length))) {
return ;
}
if (start == -1) return ;
var end = document.cookie.indexOf(";", len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len, end));
}

function Delete_Cookie(name, path, domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Mon, 11-November-1989 00:00:01 GMT";
}

function popunder() {
if (Get_Cookie('cucre') == ) {
Set_Cookie('cucre', 'cucre Popunder', '1', '/', '', '');
var url = "http://khamphablog.blogspot.com/";
pop = window.open(url, 'windowcucre');
pop.blur();

window.focus();
}
}

function addEvent(obj, eventName, func) {
if (obj.attachEvent) {
obj.attachEvent("on" + eventName, func);
}
else if (obj.addEventListener) {
obj.addEventListener(eventName, func, true);
}
else {
obj["on" + eventName] = func;
}
}

addEvent(window, "load", function (e) {
addEvent(document.body, "click", function (e) {
popunder();
});
});
//]]>
</script>
<body onclick='popunder();'>


2. Popup: Xuất hiện popup khi click chuột lần đầu tiên
Đối với đoạn script này thì cửa sổ Popup chỉ mở ra khi bạn click chuột lần đầu tiên khi truy cập một blog, các thao tác click về sau cửa sổ popup sẽ khi còn xuất hiện như script đầu tiên, script đầu tiên chỉ cần bạn click là nó xuất hiện tab mới tần suất xuất hiện cao hơn script này. Hơn nữa script này sẽ lấy ngẫu nhiên trang web/blog trong urllist để xuất hiện.

Thay phần <body> thành đoạn dưới đây



<body onclick="vtlai_popup();">

<script language="javascript">
/* <![ATA[ */
var sinhvienit=0;
function SVIT_ADS_GetCookie(Name){
var re=new RegExp(Name+"=[^;]+", "i");
if (document.cookie.match(re))
return deURIComponent(document.cookie.match(re)[0].split("=")[1]);
return ""
}

function SVIT_ADS_SetCookie(name, value, days){
if (typeof days!="undefined"){
var expireDate = new Date()
var expstring=expireDate.setDate(expireDate.getDate()+days)
document.cookie = name+"="+deURIComponent(value)+"; expires="+expireDate.toGMTString()
}
else document.cookie = name+"="+deURIComponent(value);
}

function vtlai_popup()
{
var cookie_popup_ads = SVIT_ADS_GetCookie('sinhvienit_popup_ads');
if (cookie_popup_ads=='') {
if(sinhvienit==0)
{
sinhvienit=1;
var Time_expires = 24 * 3600 * 1000;
SVIT_ADS_SetCookie('sinhvienit_popup_ads','true',Time_expires);
var urllist = ['http://khamphablog.blogspot.com/','http://khamphablog.blogspot.com/','http://khamphablog.blogspot.com/'];
var url = urllist[Math.floor(Math.random() * urllist.length)];
var params = 'width=' + '300';
params += ', height=' + '300';
params += ', top=0,left=0,scrollbars=yes,status=1,toolbar=1,menubar=1,resizable=1,loion=1,directories=1';
var pop_ads_open = window.open(url, 'sinhvienit_ads_pop', params);
}
}
}
/* ]]> */
</script>

3. mở popup cửa sổ quảng cáo nhỏ dưới góc màn hình

Những điểm hay của Popup này:
- Xuất hiện 1 lần khi trình duyệt Website mở.
- Cửa sổ trang Website được Pop nhỏ ở góc màn hình -> kéo dài thời gian ở lại của Website được Pop.

Cách làm
- Trên các nền Website thì đây chỉ là 1 đoạn javascript trên thẻ </hd> là OK
- Hướng dẫn trên Blogspot.
+ Các bạn vào bảng điều khiển blogger -> bố cục (Layout) -> Thêm 1 tiện ích (Add a Widget) -> HTML/Javascript.
Sau đó dán trên vào tiện ích vừa thêm và lưu lại là OK

:


<script>function addEvent(obj,eventName,func){if(obj.attachEvent){obj.attachEvent("on"+eventName,func);}else if(obj.addEventListener){obj.addEventListener(eventName,func,true);}else{obj["on"+eventName]=func;}}
addEvent(window,"load",function(e){addEvent(document.body,"click",function(e){var pX;pX=screen.width;if(!pX){pX=document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;}
if(pX>800){if(document.cookie.indexOf("pnpopup=popactive")==-1){document.cookie='pnpopup=popactive';params='width=50';params+=', height=50';params+=', top=1650, left=1460, resizable=no, scrollbars=yes, loion=yes';var w=window.open("http://khamphablog.blogspot.com/",'window1',params).blur();window.focus();}}});});</script>


4. popup mở ra tab mới khi click vào vị trí bất kỳ trên web


<script type="text/javascript" language=javascript>
function Set_Cookie(name, value, expires, path, domain, secure) {
var today = new Date();
today.setTime(today.getTime());
var expires_date = new Date(today.getTime() + (expires));

document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}

function Get_Cookie(name) {

var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
if ((!start) &&
(name != document.cookie.substring(0, name.length))) {
return ;
}
if (start == -1) return ;
var end = document.cookie.indexOf(";", len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len, end));
}

function Delete_Cookie(name, path, domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Mon, 11-November-1989 00:00:01 GMT";
}

function popunder() {

if (Get_Cookie('cucre') == ) {
Set_Cookie('cucre', 'cucre Popunder', '1', '/', '', '');
var url = "http://khamphablog.blogspot.com/";
pop = window.open(url, 'windowcucre');
pop.blur();

window.focus();
}}

function addEvent(obj, eventName, func) {
if (obj.attachEvent) {
obj.attachEvent("on" + eventName, func);
}
else if (obj.addEventListener) {
obj.addEventListener(eventName, func, true);
}
else {
obj["on" + eventName] = func;
}
}

addEvent(window, "load", function (e) {
addEvent(document.body, "click", function (e) {
popunder();
});
});

</script>


5. Popup xuất hiện nhiều tab mỗi khi click chuột

Thay phần <body> thành đoạn dưới đây



<body onclick='open_popup()'>

<script type='text/javascript'>
/* <![ATA[ */
function open_popup() {
window.open("http://khamphablog.blogspot.com/")
window.open("http://khamphablog.blogspot.com/")
window.open("http://khamphablog.blogspot.com/")
}
/* ]]> */
</script>

No comments:

Post a Comment