JavaScript 상단에서 떨어지는 메뉴 (Family Site)
페이지 정보
본문
<style type="text/css">
#jsddm { margin:0; padding:0; text-align:left; z-index:10000; }
#jsddm li { float:left; list-style:none; font:12px Tahoma, Arial; background:url(img/icon_toplink_bar2.png) right no-repeat #f8f8f8; border-top:1px solid #e4e4e4; }
#jsddm li a { display:block; padding:0px; text-decoration:none; height:30px; line-height:30px; border-right:1px solid #e4e4e4; border-left:1px solid #e4e4e4; border-bottom:0px solid #e4e4e4; width:118px; color:#909090; white-space:nowrap; }
#jsddm li a:hover { color:#313131; }
#jsddm li ul { margin:0; padding:0; position:absolute; visibility:hidden; border-top:1px solid #f8f8f8; border-bottom:1px solid #e4e4e4; z-index:10000; }
#jsddm li ul li { float:none; display:inline; }
#jsddm li ul li a { width:auto; background:#f8f8f8; color:#24313C; min-width:118px; }
#jsddm li ul li a:hover { color:464646; font-weight:bold; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
function jsddm_open() {
jsddm_canceltimer();
jsddm_close();
ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');
}
function jsddm_close() {
if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
}
function jsddm_timer() {
closetimer = window.setTimeout(jsddm_close, timeout);
}
function jsddm_canceltimer() {
if(closetimer) {
window.clearTimeout(closetimer);
closetimer = null;
}
}
$(document).ready(function() {
$('#jsddm > li').bind('mouseover', jsddm_open);
$('#jsddm > li').bind('mouseout', jsddm_timer);
});
document.onclick = jsddm_close;
</script>
<ul id="jsddm">
<li><a href="#"> Family site</a>
<ul>
<li><a href="https://www.happyjung.com" target="_blank"> 해피정닷컴</a></li>
<li><a href="http://www.google.com" target="_blank"> 구글</a></li>
<li><a href="http://www.daum.net" target="_blank"> 다음</a></li>
<li><a href="http://www.naver.com" target="_blank"> 네이버</a></li>
</ul>
</li>
</ul>
<div style="clear:both;"> </div>
참고자료
http://javascript-array.com/scripts/jquery_simple_drop_down_menu
#jsddm { margin:0; padding:0; text-align:left; z-index:10000; }
#jsddm li { float:left; list-style:none; font:12px Tahoma, Arial; background:url(img/icon_toplink_bar2.png) right no-repeat #f8f8f8; border-top:1px solid #e4e4e4; }
#jsddm li a { display:block; padding:0px; text-decoration:none; height:30px; line-height:30px; border-right:1px solid #e4e4e4; border-left:1px solid #e4e4e4; border-bottom:0px solid #e4e4e4; width:118px; color:#909090; white-space:nowrap; }
#jsddm li a:hover { color:#313131; }
#jsddm li ul { margin:0; padding:0; position:absolute; visibility:hidden; border-top:1px solid #f8f8f8; border-bottom:1px solid #e4e4e4; z-index:10000; }
#jsddm li ul li { float:none; display:inline; }
#jsddm li ul li a { width:auto; background:#f8f8f8; color:#24313C; min-width:118px; }
#jsddm li ul li a:hover { color:464646; font-weight:bold; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
function jsddm_open() {
jsddm_canceltimer();
jsddm_close();
ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');
}
function jsddm_close() {
if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
}
function jsddm_timer() {
closetimer = window.setTimeout(jsddm_close, timeout);
}
function jsddm_canceltimer() {
if(closetimer) {
window.clearTimeout(closetimer);
closetimer = null;
}
}
$(document).ready(function() {
$('#jsddm > li').bind('mouseover', jsddm_open);
$('#jsddm > li').bind('mouseout', jsddm_timer);
});
document.onclick = jsddm_close;
</script>
<ul id="jsddm">
<li><a href="#"> Family site</a>
<ul>
<li><a href="https://www.happyjung.com" target="_blank"> 해피정닷컴</a></li>
<li><a href="http://www.google.com" target="_blank"> 구글</a></li>
<li><a href="http://www.daum.net" target="_blank"> 다음</a></li>
<li><a href="http://www.naver.com" target="_blank"> 네이버</a></li>
</ul>
</li>
</ul>
<div style="clear:both;"> </div>
참고자료
http://javascript-array.com/scripts/jquery_simple_drop_down_menu
댓글목록
등록된 댓글이 없습니다.