Tạo Popup nhanh, đẹp và tắt liên kết popup hoàn toàn tự động


Bước 1 : Chèn code CSS sau trên dòng : ]]></b:skin>


<!-- Code CSS thu thuat ban quyen thuoc www.nsvina.com -->
.titlebar {height: 20px; background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjqahWXi64X8TZxDTk-Kls30h_7TwA1IS7X02HBjWVTGtsDX0BR9Ag9uHNoDMZagWpSTVYqZVASh4WObsaC2FcJ66Xh_vPC1fnKt5RCdJFE_VvumzquQrhBbQkU_2_MVGL6EoYo2DkAcA/s1600/redbg.png) repeat-x; }
.titlebar span {float: left; margin: 2px 0 0 5px; color: #ffffff !important; font-weight: normal !important}
.dismiss {display: block; background: url(red-close.png) no-repeat; height: 20px; width: 70px; float: right;}
.msgwrap {clear: both; padding: 2px; background: #ff0000;width: auto; color: #ffffff !important; }
.msgwrap a {color: #d8ff00 !important}
<!-- End Code CSS thu thuat ban quyen thuoc www.nsvina.com -->


Bước 2 : Thêm tiện ích : HTML/JavascriptThêm  và copy toàn bộ code bên dưới bỏ vào là xong !


<!-- Code thu thuat ban quyen thuoc www.nsvina.com -->

<script language="javascript" type="text/javascript">



// Drop-in content box- By Dynamic Drive

// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com

// This credit MUST stay intact for use

// Modifications by WebsiteDons.com - Autohide, Frequency re-configuration



var freq="always"

var autohide=["yes", 5]



if (parseInt(freq)!=NaN)

var random_num=Math.floor(Math.random()*freq)

var ie=document.all

var dom=document.getElementById

var ns4=document.layers

var calunits=document.layers? "" : "px"



var bouncelimit="32"

var direction="up"



function initbox(){

if (!dom&&!ie&&!ns4)

return

crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin

scroll_top=(ie)? truebody().scrollTop : window.pageYOffset

crossobj.top=scroll_top-250+calunits

crossobj.visibility=(dom||ie)? "visible" : "show"

dropstart=setInterval("dropin()",50)

autoclose()

}



function dropin(){

scroll_top=(ie)? truebody().scrollTop : window.pageYOffset

if (parseInt(crossobj.top)<100+scroll_top)

crossobj.top=parseInt(crossobj.top)+40+calunits

else{

clearInterval(dropstart)

bouncestart=setInterval("bouncein()",50)

autoclose()

}

}



function bouncein(){

crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits

if (bouncelimit<0)

bouncelimit+=8

bouncelimit=bouncelimit*-1

if (bouncelimit==0){

clearInterval(bouncestart)

autoclose()

}

}



function dismissbox(){

if (window.bouncestart) clearInterval(bouncestart)

crossobj.visibility="hidden"

}



function autoclose(){

if (autohide[0]=="yes"){

setTimeout("dismissbox()", autohide[1]*1000)

}

}



function dropwin(){

bouncelimit=32

direction="up"

initbox()

}



function truebody(){

return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body

}



function get_cookie(Name) {

var search = Name + "="

var returnvalue = ""

if (document.cookie.length > 0) {

offset = document.cookie.indexOf(search)

if (offset != -1) {

offset += search.length

end = document.cookie.indexOf(";", offset)

if (end == -1)

end = document.cookie.length;

returnvalue=unescape(document.cookie.substring(offset, end))

}

}

return returnvalue;

}



if (freq=="oncepersession" && get_cookie("dropinmod")=="" || freq=="always" || parseInt(freq)!=NaN && random_num==0){

if (document.getElementById || document.all)

window.onload=initbox



if (freq=="oncepersession")

document.cookie="dropinmod=yes"



if (freq=="never")

initibox()

}



</script> 
<div id="dropin" style="position:absolute;visibility:hidden;left:0px; right: 0px; top:100px;z-index:99999;background: transparent; font-size: 11px !important; line-height: 1.5em;"><div style="margin: auto !important; width:730px"><div class="titlebar"><span>KHUYẾN MẠI THÁNG 8: <b>FORM QUẢNG CÁO SẼ TỰ ĐỘNG TẮT SAU VÀU GIÂY (S)</b></span><a class="dismiss" href="#" onclick="dismissbox();return false"></a></div><div class="msgwrap"><div class="mainmsg"><a href="Link của bạn" onclick="dismissbox();return true" target="_parent"><img src="Hình ảnh của bạn" /></a><br />( Chương trình chỉ áp dụng từ ngày 01 / 08 / 2011 đến hết ngày 30/08/2011  )</div></div></div></div>

<!-- End Code thu thuat ban quyen thuoc www.nsvina.com -->



Vậy là xong nhé! Chúc mọi người thực hiện thành công!

Mr.Mika Nguyễn
Nguồn : www.nsvina.com
SHARE

Thiết kế web chuyên nghiệp giá rẻ

Chúng tôi tuyên thiết kế web chuyên nghiệp đẳng cấp giá rẻ với 5 năm kinh nghiệm trong lĩnh vực thiết kế website nếu các bạn có nhu cầu có thể liên hệ Hotline: 0962 66 57 57 || Email: cmay.tt@gmail.com || website: cmay.vn

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 nhận xét:

Đăng nhận xét