Cộng Đồng Teen 8 - 9x
chào mừng các bạn đã đến với Forum xteen.forum-viet.net. Liên hệ - Y!M:mr.hackerphat55@yahoo.com .Gmail: mr.hackerphat@gmail.com or Y!M qua_dua_chuot2004
Cộng Đồng Teen 8 - 9x
chào mừng các bạn đã đến với Forum xteen.forum-viet.net. Liên hệ - Y!M:mr.hackerphat55@yahoo.com .Gmail: mr.hackerphat@gmail.com or Y!M qua_dua_chuot2004
Cộng Đồng Teen 8 - 9x
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.

Cộng Đồng Teen 8 - 9x

Chào mừng các bạn đã đến với forum teen 8 - 9x !!! Chúc bạn có một ngày vui vẻ tại forum (^^)
 
Trang ChínhNewsLatest imagesTìm kiếmĐăng kýĐăng Nhập
Chào mừng đến với Xteen
 Mr.Hackerphat (53)
 Media (22)
 natural_kingdom (7)
 ¯™Dũng™¯ (6)
 petinh_3011 (3)
 R.I.N (3)
 nhungseny (2)
 nakata1991 (2)
 Kanz (1)
 SieuTrom_2012 (1)

Share | 

 

 Menu "Megaanchor" dạng nén cho mọi website

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down 
Sat Oct 16, 2010 8:37 am

Mr.Hackerphat
Admin
Mr.Hackerphat

Admin

https://xteen.forum-viet.net
Giới tính : Nam
Cung Hòang Đạo : Libra
Tổng số bài gửi : 53
Được Thank : 4
Birthday : 10/10/1994
Join date : 10/09/2010
Age : 29
Đến từ : Long An
Tài năng của Mr.Hackerphat Người này hiện đang:
Level: Admin
Danh vọng:53%/1000%
Tài năng:29%/100%

Bài gửiTiêu đề: Menu "Megaanchor" dạng nén cho mọi website

 








jQuery.noConflict();

var jkmegamenu={

effectduration: 300, //duration of animation, in milliseconds
delaytimer: 200, //delay after mouseout before menu should be hidden, in milliseconds

//No need to edit beyond here
megamenulabels: [],
megamenus: [], //array to contain each block menu instances
zIndexVal: 1000, //starting z-index value for drop down menu
$shimobj: null,

addshim:function($){
$(document.body).append('')
this.$shimobj=$("#outlineiframeshim")
},

alignmenu:function($, e, megamenu_pos){
var megamenu=this.megamenus[megamenu_pos]
var $anchor=megamenu.$anchorobj
var $menu=megamenu.$menuobj
var menuleft=($(window).width()-(megamenu.offsetx-$(document).scrollLeft())>megamenu.actualwidth)? megamenu.offsetx : megamenu.offsetx-megamenu.actualwidth+megamenu.anchorwidth //get x coord of menu
//var menutop=($(window).height()-(megamenu.offsety-$(document).scrollTop()+megamenu.anchorheight)>megamenu.actualheight)? megamenu.offsety+megamenu.anchorheight : megamenu.offsety-megamenu.actualheight
var menutop=megamenu.offsety+megamenu.anchorheight //get y coord of menu
$menu.css({left:menuleft+"px", top:menutop+"px"})
this.$shimobj.css({width:megamenu.actualwidth+"px", height:megamenu.actualheight+"px", left:menuleft+"px", top:menutop+"px", display:"block"})
},

showmenu:function(e, megamenu_pos){
var megamenu=this.megamenus[megamenu_pos]
var $menu=megamenu.$menuobj
var $menuinner=megamenu.$menuinner
if ($menu.css("display")=="none"){
this.alignmenu(jQuery, e, megamenu_pos)
$menu.css("z-index", ++this.zIndexVal)
$menu.show(this.effectduration, function(){
$menuinner.css('visibility', 'visible')
})
}
else if ($menu.css("display")=="block" && e.type=="click"){ //if menu is hidden and this is a "click" event (versus "mouseout")
this.hidemenu(e, megamenu_pos)
}
return false
},

hidemenu:function(e, megamenu_pos){
var megamenu=this.megamenus[megamenu_pos]
var $menu=megamenu.$menuobj
var $menuinner=megamenu.$menuinner
$menuinner.css('visibility', 'hidden')
this.$shimobj.css({display:"none", left:0, top:0})
$menu.hide(this.effectduration)
},

definemenu:function(anchorid, menuid, revealtype){
this.megamenulabels.push([anchorid, menuid, revealtype])
},

render:function($){
for (var i=0, labels=this.megamenulabels[i]; iif ($('#'+labels[0]).length!=1 || $('#'+labels[1]).length!=1) //if one of the two elements are NOT defined, exist
return
this.megamenus.push({$anchorobj:$("#"+labels[0]), $menuobj:$("#"+labels[1]), $menuinner:$("#"+labels[1]).children('ul:first-child'), revealtype:labels[2], hidetimer:null})
var megamenu=this.megamenus[i]
megamenu.$anchorobj.add(megamenu.$menuobj).attr("_megamenupos", i+"pos") //remember index of this drop down menu
megamenu.actualwidth=megamenu.$menuobj.outerWidth()
megamenu.actualheight=megamenu.$menuobj.outerHeight()
megamenu.offsetx=megamenu.$anchorobj.offset().left
megamenu.offsety=megamenu.$anchorobj.offset().top
megamenu.anchorwidth=megamenu.$anchorobj.outerWidth()
megamenu.anchorheight=megamenu.$anchorobj.outerHeight()
$(document.body).append(megamenu.$menuobj) //move drop down menu to end of document
megamenu.$menuobj.css("z-index", ++this.zIndexVal).hide()
megamenu.$menuinner.css("visibility", "hidden")
megamenu.$anchorobj.bind(megamenu.revealtype=="click"? "click" : "mouseenter", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
return jkmegamenu.showmenu(e, parseInt(this.getAttribute("_megamenupos")))
})
megamenu.$anchorobj.bind("mouseleave", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
if (e.relatedTarget!=menuinfo.$menuobj.get(0) && $(e.relatedTarget).parents("#"+menuinfo.$menuobj.get(0).id).length==0){ //check that mouse hasn't moved into menu object
menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
}, jkmegamenu.delaytimer)
}
})
megamenu.$menuobj.bind("mouseenter", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
})
megamenu.$menuobj.bind("click mouseleave", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
}, jkmegamenu.delaytimer)
})
} //end for loop
if(/Safari/i.test(navigator.userAgent)){ //if Safari
$(window).bind("resize load", function(){
for (var i=0; ivar megamenu=jkmegamenu.megamenus[i]
var $anchorisimg=(megamenu.$anchorobj.children().length==1 && megamenu.$anchorobj.children().eq(0).is('img'))? megamenu.$anchorobj.children().eq(0) : null
if ($anchorisimg){ //if anchor is an image link, get offsets and dimensions of image itself, instead of parent A
megamenu.offsetx=$anchorisimg.offset().left
megamenu.offsety=$anchorisimg.offset().top
megamenu.anchorwidth=$anchorisimg.width()
megamenu.anchorheight=$anchorisimg.height()
}
}
})
}
else{
$(window).bind("resize", function(){
for (var i=0; ivar megamenu=jkmegamenu.megamenus[i]
megamenu.offsetx=megamenu.$anchorobj.offset().left
megamenu.offsety=megamenu.$anchorobj.offset().top
}
})
}
jkmegamenu.addshim($)
}

}

jQuery(document).ready(function($){
jkmegamenu.render($)
})




http://jkmegamenu.definemenu("anchorid", "menuid", "mouseover|click")
jkmegamenu.definemenu("megaanchor", "megamenu1", "mouseover")





MENU



Code:

<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<style type="text/css">
.megamenu{
position: absolute;
display: none;
left: 0;
top: 0;
background: white;
border: 1px solid #f06b24;
border-width: 5px 5px;
padding: 10px;
font: normal 12px verdanal;
z-index: 100;

}

.megamenu .column{
float: left;
width: 180px;
margin-right: 5px;
}

.megamenu .column ul{
margin: 0;
padding: 0;
list-style-type: none;
}

.megamenu .column ul li{
padding-bottom: 5px;
}

.megamenu .column h3{
background: #e0e0e0;
font: bold 13px verdana;
margin: 0 0 5px 0;
}

.megamenu .column ul li a{
text-decoration: none;
}

.megamenu .column ul li a:hover{
color: red;
}
</style>

<script type="text/javascript">


jQuery.noConflict();

var jkmegamenu={

effectduration: 300, //duration of animation, in milliseconds
delaytimer: 200, //delay after mouseout before menu should be hidden, in milliseconds

//No need to edit beyond here
megamenulabels: [],
megamenus: [], //array to contain each block menu instances
zIndexVal: 1000, //starting z-index value for drop down menu
$shimobj: null,

addshim:function($){
$(document.body).append('<IFRAME id="outlineiframeshim" src="'+(location.protocol=="https:"? 'blank.htm' : 'about:blank')+'" style="display:none; left:0; top:0; z-index:999; position:absolute; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
this.$shimobj=$("#outlineiframeshim")
},

alignmenu:function($, e, megamenu_pos){
var megamenu=this.megamenus[megamenu_pos]
var $anchor=megamenu.$anchorobj
var $menu=megamenu.$menuobj
var menuleft=($(window).width()-(megamenu.offsetx-$(document).scrollLeft())>megamenu.actualwidth)? megamenu.offsetx : megamenu.offsetx-megamenu.actualwidth+megamenu.anchorwidth //get x coord of menu
//var menutop=($(window).height()-(megamenu.offsety-$(document).scrollTop()+megamenu.anchorheight)>megamenu.actualheight)? megamenu.offsety+megamenu.anchorheight : megamenu.offsety-megamenu.actualheight
var menutop=megamenu.offsety+megamenu.anchorheight //get y coord of menu
$menu.css({left:menuleft+"px", top:menutop+"px"})
this.$shimobj.css({width:megamenu.actualwidth+"px", height:megamenu.actualheight+"px", left:menuleft+"px", top:menutop+"px", display:"block"})
},

showmenu:function(e, megamenu_pos){
var megamenu=this.megamenus[megamenu_pos]
var $menu=megamenu.$menuobj
var $menuinner=megamenu.$menuinner
if ($menu.css("display")=="none"){
this.alignmenu(jQuery, e, megamenu_pos)
$menu.css("z-index", ++this.zIndexVal)
$menu.show(this.effectduration, function(){
$menuinner.css('visibility', 'visible')
})
}
else if ($menu.css("display")=="block" && e.type=="click"){ //if menu is hidden and this is a "click" event (versus "mouseout")
this.hidemenu(e, megamenu_pos)
}
return false
},

hidemenu:function(e, megamenu_pos){
var megamenu=this.megamenus[megamenu_pos]
var $menu=megamenu.$menuobj
var $menuinner=megamenu.$menuinner
$menuinner.css('visibility', 'hidden')
this.$shimobj.css({display:"none", left:0, top:0})
$menu.hide(this.effectduration)
},

definemenu:function(anchorid, menuid, revealtype){
this.megamenulabels.push([anchorid, menuid, revealtype])
},

render:function($){
for (var i=0, labels=this.megamenulabels[i]; i<this.megamenulabels.length; i++, labels=this.megamenulabels[i]){
if ($('#'+labels[0]).length!=1 || $('#'+labels[1]).length!=1) //if one of the two elements are NOT defined, exist
return
this.megamenus.push({$anchorobj:$("#"+labels[0]), $menuobj:$("#"+labels[1]), $menuinner:$("#"+labels[1]).children('ul:first-child'), revealtype:labels[2], hidetimer:null})
var megamenu=this.megamenus[i]
megamenu.$anchorobj.add(megamenu.$menuobj).attr("_megamenupos", i+"pos") //remember index of this drop down menu
megamenu.actualwidth=megamenu.$menuobj.outerWidth()
megamenu.actualheight=megamenu.$menuobj.outerHeight()
megamenu.offsetx=megamenu.$anchorobj.offset().left
megamenu.offsety=megamenu.$anchorobj.offset().top
megamenu.anchorwidth=megamenu.$anchorobj.outerWidth()
megamenu.anchorheight=megamenu.$anchorobj.outerHeight()
$(document.body).append(megamenu.$menuobj) //move drop down menu to end of document
megamenu.$menuobj.css("z-index", ++this.zIndexVal).hide()
megamenu.$menuinner.css("visibility", "hidden")
megamenu.$anchorobj.bind(megamenu.revealtype=="click"? "click" : "mouseenter", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
return jkmegamenu.showmenu(e, parseInt(this.getAttribute("_megamenupos")))
})
megamenu.$anchorobj.bind("mouseleave", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
if (e.relatedTarget!=menuinfo.$menuobj.get(0) && $(e.relatedTarget).parents("#"+menuinfo.$menuobj.get(0).id).length==0){ //check that mouse hasn't moved into menu object
menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
}, jkmegamenu.delaytimer)
}
})
megamenu.$menuobj.bind("mouseenter", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
clearTimeout(menuinfo.hidetimer) //cancel hide menu timer
})
megamenu.$menuobj.bind("click mouseleave", function(e){
var menuinfo=jkmegamenu.megamenus[parseInt(this.getAttribute("_megamenupos"))]
menuinfo.hidetimer=setTimeout(function(){ //add delay before hiding menu
jkmegamenu.hidemenu(e, parseInt(menuinfo.$menuobj.get(0).getAttribute("_megamenupos")))
}, jkmegamenu.delaytimer)
})
} //end for loop
if(/Safari/i.test(navigator.userAgent)){ //if Safari
$(window).bind("resize load", function(){
for (var i=0; i<jkmegamenu.megamenus.length; i++){
var megamenu=jkmegamenu.megamenus[i]
var $anchorisimg=(megamenu.$anchorobj.children().length==1 && megamenu.$anchorobj.children().eq(0).is('img'))? megamenu.$anchorobj.children().eq(0) : null
if ($anchorisimg){ //if anchor is an image link, get offsets and dimensions of image itself, instead of parent A
megamenu.offsetx=$anchorisimg.offset().left
megamenu.offsety=$anchorisimg.offset().top
megamenu.anchorwidth=$anchorisimg.width()
megamenu.anchorheight=$anchorisimg.height()
}
}
})
}
else{
$(window).bind("resize", function(){
for (var i=0; i<jkmegamenu.megamenus.length; i++){
var megamenu=jkmegamenu.megamenus[i]
megamenu.offsetx=megamenu.$anchorobj.offset().left
megamenu.offsety=megamenu.$anchorobj.offset().top
}
})
}
jkmegamenu.addshim($)
}

}

jQuery(document).ready(function($){
jkmegamenu.render($)
})
</script>

<script type="text/javascript">

http://jkmegamenu.definemenu("anchorid", "menuid", "mouseover|click")
jkmegamenu.definemenu("megaanchor", "megamenu1", "mouseover")

</script>



<a href="http://code1k.com" id="megaanchor"><img alt="" src="http://c.upanh.com//upload/1/905/DC0.4496347_25259_5792.png" style="border:0px"/ > MENU </a>

<div id="megamenu1" class="megamenu">

<div class="column">
<h3><img src="http://c.upanh.com//upload/1/905/KD0.4496337_25259_5792.png" alt="" style="border:0px;"/ > Sản phẩm</h3>
<ul>
<li><a href="http://www.code1k.com/2010/05/huong-dan-cung-cap-con-tro-chuot-dep.html"> Con trỏ chuột </a></li>
<li><a href="http://www.code1k.com/2010/05/nhung-hinh-nen-tuyet-dep-co-do-phan.html"> Hình nền wallpaper </a></li>
<li><a href="http://www.code1k.com/2010/05/hieu-ung-flash-nen-dep-cho-blog-website.html"> Hiệu ứng flash nền </a></li>
<li><a href="http://www.code1k.com/2010/05/bo-suu-tap-nhung-icons-nho-tuyet-dep.html"> Biểu tượng icons </a></li>
<li><a href="http://www.code1k.com/2010/06/bo-suu-tap-mat-cuoi-emoticons-du-loai.html"> Biểu tượng mặt cười </a></li>
</ul>
</div>

<div class="column">
<h3><img src="http://c.upanh.com//upload/1/905/890.4496333_25259_5792.png" alt="" style="border:0px;"/ > Trang chủ</h3>
<ul>
<li><a href="http://code1k.com">Trang chủ</a></li>
<li><a href="http://code1k.com">Đăng nhập</a></li>
<li><a href="http://code1k.com">Control Panel</a></li>
<li><a href="http://code1k.com">Thoát</a></li>
</ul>
</div>

<div class="column">
<h3><img src="http://ca3.upanh.com/upload/6/908/CS0.11094114_29781_1.png" alt="" style="border:0px;"/ > Nổi bậc</h3>
<ul>
<li><a href="http://code1k.com"> Hoangtuchotkhoc </a></li>
<li><a href="http://code1k.com"> Si3uc0de </a></li>
<li><a href="http://code1k.com"> Ka_kent </a></li>
<li><a href="http://code1k.com"> Script3000 </a></li>
</ul>
</div>

<br style="clear: left" />

<div class="column">
<h3><img src="http://ca2.upanh.com/upload/6/908/CS0.11093954_29781_1.png" alt="" style="border:0px;"/ > Tiện ích</h3>
<ul>
<li><a href="http://code1k.com"> Mã hóa code </a></li>
<li><a href="http://code1k.com"> Dịch thuật javascript </a></li>
<li><a href="http://code1k.com"> Tối ưu CSS</a></li>
<li><a href="http://code1k.com"> Bảng mã màu</a></li>
<li><a href="http://code1k.com"> Photoshop</a></li>
</ul>
</div>

<div class="column">
<h3><img src="http://ca3.upanh.com/upload/6/911/E80.11096838_29781_1.png" alt="" style="border:0px;"/ > Tài khoản</h3>
<ul>
<li><a href="http://code1k.com">Gmail</a></li>
<li><a href="http://code1k.com">Yahoo</a></li>
<li><a href="http://code1k.com">Google</a></li>
<li><a href="http://code1k.com">Blogger</a></li>
</ul>
</div>

<div class="column">
<h3><img src="http://ca5.upanh.com/upload/6/909/CS0.11094468_29781_1.png" alt="" style="border:0px;"/ > Tác vụ</h3>
<ul>
<li><a href="http://code1k.com">Xem thống kê</a></li>
<li><a href="http://code1k.com">Chặn IP</a></li>
<li><a href="http://code1k.com">Duyệt code</a></li>
<li><a href="http://code1k.com">Đóng góp code</a></li>
</ul>
</div>

</div>



Theo b?n, ch? d? này du?c m?y sao:
Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang
 

Menu "Megaanchor" dạng nén cho mọi website

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang 
Trang 1 trong tổng số 1 trang

Liên hệ với chúng tôi | https://xteen.forum-viet.net/forum.htm |Trở lên trên
Diễn đàn sáng lập bởi Admin & Tất cả thành viên trong forum cùng góp sức
Địa chỉ: Ô 7 - KhuB - Thị Trấn Hậu Nghĩa - Huyện Đức Hòa - Tỉnh Long An
Điện thoại: 0926017407
Email: ngoisaotinhyeu_813@yahoo.com or Mr.hackerphat55@yahoo.com
Gmail: Mr.Hackerphat@gmail.com Forum xteenfor.tk
Mr.Hackerphat
--> Nguồn: vBulletin 3.8.x <--
| letrieuthien.com
Free forum | ©phpBB | Free forum support | Báo cáo lạm dụng | Thảo luận mới nhất