플레쉬 메뉴를 표방한..=ㅁ= 자바스크립트의 수작 버튼 밑으로 스크롤 되는 아이콘입니다.

· 19년 전 · 2324
전에 한번 비슷하지만 좀 모자란듯한 소스를 올렸었는데요.

약간의 옵션을 넣어서 만들어 봤습니다.

설명을 하자면

- 가로로된 메뉴 바가 있구요 그 바속에 메뉴버튼이 있습니다. 하이퍼 링크걸려있구요

버튼에 마우스 오버시 그버튼 아래 작은 막대가 버튼의 위치로 이동합니다. 물론 슬라이딩하죠..

여기까지가 지난번 소스였는데요. 옵션을 넣은것은

버튼들이 처음 등장시 blendtrans 효과를 넣어 뿌스스 하게 등장합니다.

그리고 버튼의 사이즈에 따라 버튼밑의 막대가 슬라이딩함과동시에 사이즈가 늘었다 줄었다 합니다.

무슨뜻인지 아시겠죠? 플레쉬로 자주 보시던 겁니다. ( 플레쉬 못하는 관계로..-ㅁ- 수작좀 부렸습니다. )

아직은 남한테 가르쳐줄만한 실력은 못되지만 나름대로 열심히 했구요 원하시는 분들이 좀 계시면..

가로와 세로메뉴를 자유자제로 적용하게 할거구요 그담에 지금은 소스를 수정하셔야 합니다..아쉽게도..-ㅁ-;

수정없이 사용하게 하려면 이미지사이즈 자동측정해서 막대가 자유자재로 변하게도 해야할것같구

다만 실력부족과 그런기능이 있으면 느려질태구..그래서 걱정이네요.. 주석은 안달았습니다. 원하시는 분들이 없는거 같아서요

암튼 소스랑 예제 나갑니다.

=======================================================================================
----- 죄송합니다. 링크가 깨졌습니다. 이미지도 없구요..ㅡㅜ 예제는 못보실것 같네요..--------
예제) http://goweb.netcci.org/pds/menu.html
=======================================================================================

-------------------------------------------------------------------------------------------------------------


<script language="JavaScript" type="text/javascript">
<!--
var IconPos = 5; // 처음 페이지 로딩시 메뉴 밑의 슬라이딩 아이콘의 위치정의
var ReImage = 55; // " " " 넓이정의
//-->
</script>



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

<!--

function MM_preloadImages() { //v3.0 // 이미지를 모두 로딩후 페이지 표시
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function Fade(_id,_visibility) { // blendtrans효과를 위한 함수
document.all[_id].style.filter="blendTrans(duration=1)";
if(document.all[_id].filters.blendTrans.status != 1){
document.all[_id].filters.blendTrans.apply();
document.all[_id].style.visibility=_visibility;
document.all[_id].filters.blendTrans.play();
}
}


// 메뉴아이콘의 슬라이딩
var isRun = 0;
var Loop3 = null;
var MovingSpe = null;
var Speed1 = 4 /// 속도 입니다. 낮은 숫자일수록 빨리 움직입니다.
function MovingIcon(value){
isRun = 1;
if(Loop3)clearTimeout(Loop3);
var _id = "menu_mouse";
var Tmpvalue = value;
var Tmpvalue2 = value;
if(document.all[_id].style.pixelLeft <= Tmpvalue){
MovingSpd = Math.round((Tmpvalue-document.all[_id].style.pixelLeft)/Speed1);
if(MovingSpd == 0){
if(document.all[_id].style.pixelLeft < Tmpvalue){
MovingSpd = 1;
}
}
document.all[_id].style.pixelLeft += MovingSpd;
Loop3 = setTimeout("MovingIcon("+Tmpvalue+")",1);
}else if(document.all[_id].style.pixelLeft >= Tmpvalue2){
MovingSpd = Math.round((document.all[_id].style.pixelLeft-Tmpvalue2)/Speed1);
if(MovingSpd == 0){
if(document.all[_id].style.pixelLeft > Tmpvalue2){
MovingSpd = 1;
}
}
document.all[_id].style.pixelLeft -= MovingSpd;
Loop3 = setTimeout("MovingIcon("+Tmpvalue2+")",1);
}else clearTimeout(Loop3);
}


// Menu button의 등장
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var ArrDivs = new Array("menu_1","menu_2","menu_3","menu_4","menu_5"); //---- 메뉴의 갯수에 따라 배열값을 늘려주세요 ("menu_1",......"menu_10");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var ArrCounts = 0;
var tmp = null;
function ShowDiv2(){
clearTimeout(Loop);
//if(ArrCounts==ArrDivs.length){if(isRun==0){MovingIcon(IconPos);ResizeImage(ReImage);}}
if(ArrCounts<ArrDivs.length){
Fade(ArrDivs[ArrCounts],'visible');
ArrCounts++;
tmp = setTimeout("ShowDiv2()",150);
}else{if(tmp)clearTimeout(tmp);
if(isRun==0){
setTimeout("MovingIcon("+IconPos+")",1200);
setTimeout("ResizeImage("+ReImage+")",1200);
}
}
}

// Image 리사이즈
var Loop4 = null;

function ResizeImage(Size){
clearTimeout(Loop4);
var Resize = 2;
if(document.MenuIconImage.width>Size){
if(document.MenuIconImage.width-Size<2) Resize = 1;
else Resize = 2;
document.MenuIconImage.width -= Resize;
document.MenuIconImage.height = 4;
Loop4 = setTimeout("ResizeImage("+Size+")",1);
}else if(document.MenuIconImage.width<Size){
if(Size-document.MenuIconImage.width<2) Resize = 1;
else Resize = 2;
document.MenuIconImage.width += Resize;
document.MenuIconImage.height = 4;
Loop4 = setTimeout("ResizeImage("+Size+")",1);
}else clearTimeout(Loop4);
}

var Loop = setTimeout("ShowDiv2()",500);

-->
</script>


<!--
상자에서의 설정은 이렇습니다.
img 태그에 name이라는 속성이 있습니다. 화면에 표시된 순서대로 왼쪽부터 menu_1 menu_2.....menu_10 이렇식으로 td 추가시 써주셔야하구요
img 태그에 onMouseOver 이벤트가 들어있습니다. 이곳에들어가는 함수호출명령도 수정하셔야 할겁니다.
MovingIcon(이곳에 아이콘이 가야할 위치를 정해줍니다. 좌표값이죠.);ResizeImage(이곳에 아이콘의 넓이를 정해줍니다.)
이두가지 호출명령에 적절한값을 넣어서 사용하시면 됩니다.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
*******************************************************
기본적으로 메뉴는 다음과같이 나열되있습니다.
<td>여기서~ 이것하나가 메뉴의 버튼 한개를 나타냅니다. ~여기까지<td>
아래처럼 복사하셔서 메뉴를 늘리실것이라면 아래의 태그를 밑에 더 써넣어주시구요
<img 태그 안에는 onMouseOver와 name을 수정하시면 됩니다.
onMouseOver는
- MovingIcon(이곳에 슬라이딩바가 가야할 위치를 정해줍니다. 좌표값이죠.);ResizeImage(이곳에 슬라이딩바의 넓이를 정해줍니다.)
위처럼 수정하시면 되구요
name은
- menu_1 menu_2.....menu_10 순서대로 넣어주시면 됨니다.
**********************************************************
<td width='46'><a href='#'><img src='http://goweb.netcci.org/pds/main_image/menu_5.gif' alt='' onMouseOver="MovingIcon(638);ResizeImage(36)" name='menu_5' style='position:abolute;visibility:hidden' border='0'></a></td>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<!-- 메뉴 상자 -->
<div id='menu_obj'>
<table border='0' bgcolor='#4B494B' width='682' background='http://goweb.netcci.org/pds/main_image/menu_bg.gif' style='border:1px solid #272727;border-bottom-color:#313131' cellpadding='0' cellspacing='0'>
<tr>
<td width='67'><a href='#'><img src='http://goweb.netcci.org/pds/main_image/menu_1.gif' alt='' onMouseOver="MovingIcon(4);ResizeImage(55)" name='menu_1' style='position:abolute;visibility:hidden' border='0'></a></td>
<td> </td>
<td width='50'><a href='#'><img src='http://goweb.netcci.org/pds/main_image/menu_2.gif' alt='' onMouseOver="MovingIcon(477);ResizeImage(42)" name='menu_2' style='position:abolute;visibility:hidden' border='0'></a></td>
<td width='38'><a href='#'><img src='http://goweb.netcci.org/pds/main_image/menu_3.gif' alt='' onMouseOver="MovingIcon(526);ResizeImage(31)" name='menu_3' style='position:abolute;visibility:hidden' border='0'></a></td>
<td width='73'><a href='#'><img src='http://goweb.netcci.org/pds/main_image/menu_4.gif' alt='' onMouseOver="MovingIcon(564);ResizeImage(66)" name='menu_4' style='position:abolute;visibility:hidden' border='0'></a></td>
<td width='46'><a href='#'><img src='http://goweb.netcci.org/pds/main_image/menu_5.gif' alt='' onMouseOver="MovingIcon(638);ResizeImage(36)" name='menu_5' style='position:abolute;visibility:hidden' border='0'></a></td>
</tr>
<tr>
<td colspan='6'><div id='menu_mouse' style='position:relative;left:5'><img src='http://goweb.netcci.org/pds/main_image/menu_mouse.gif' style='border:1px solid #272727;border-top:0px;border-bottom:0px' width='55' alt='' name='MenuIconImage' border='0'></div></td>
</tr>
</table>
</div>
<!-- 메뉴 상자 끝 -->

http://www.nzeo.com/bbs/zboard.php?id=p_javascript&page=1&sn1=&divpage=1&sn=off&ss=on&sc=off&select_arrange=vote&desc=desc&no=454<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
19년 전 조회 2,695
19년 전 조회 2,533
19년 전 조회 2,352
19년 전 조회 2,244
19년 전 조회 2,133
19년 전 조회 4,264
19년 전 조회 2,688
19년 전 조회 2,170
19년 전 조회 2,273
19년 전 조회 2,855
19년 전 조회 1,970
19년 전 조회 3,212
19년 전 조회 2,772
19년 전 조회 2,280
19년 전 조회 1,822
19년 전 조회 2,246
19년 전 조회 2,019
19년 전 조회 1,918
19년 전 조회 2,476
19년 전 조회 2,331
19년 전 조회 3,896
19년 전 조회 3,749
19년 전 조회 2,254
19년 전 조회 3,294
19년 전 조회 1,967
19년 전 조회 2,394
19년 전 조회 2,289
19년 전 조회 2,355
19년 전 조회 2,190
19년 전 조회 2,830
19년 전 조회 2,833
19년 전 조회 3,180
19년 전 조회 3,053
19년 전 조회 2,717
19년 전 조회 2,935
19년 전 조회 3,182
19년 전 조회 2,889
19년 전 조회 2,622
19년 전 조회 2,939
19년 전 조회 4,518
19년 전 조회 2,436
19년 전 조회 2,457
19년 전 조회 3,497
19년 전 조회 3,163
19년 전 조회 2,818
19년 전 조회 2,062
19년 전 조회 1,792
19년 전 조회 2,889
19년 전 조회 1,732
19년 전 조회 2,325
19년 전 조회 3,963
19년 전 조회 3,745
19년 전 조회 3,465
19년 전 조회 3,413
19년 전 조회 1,577
19년 전 조회 1,947
19년 전 조회 1,868
19년 전 조회 2,536
19년 전 조회 4,629
19년 전 조회 2,766
19년 전 조회 1,931
19년 전 조회 1,941
19년 전 조회 1,827
19년 전 조회 2,572
19년 전 조회 8,187
19년 전 조회 2,735
19년 전 조회 2,802
19년 전 조회 3,053
19년 전 조회 2,208
19년 전 조회 2,225
19년 전 조회 2,188
19년 전 조회 2,078
19년 전 조회 2,268
19년 전 조회 2,524
19년 전 조회 3,094
19년 전 조회 2,340
19년 전 조회 1,917
19년 전 조회 2,845
19년 전 조회 5,015
19년 전 조회 3,506
19년 전 조회 3,462
19년 전 조회 2,985
19년 전 조회 2,404
19년 전 조회 1,499
19년 전 조회 3,143
19년 전 조회 2,019
19년 전 조회 5,381
19년 전 조회 2,446
19년 전 조회 3,441
19년 전 조회 2,866
19년 전 조회 1,775
19년 전 조회 3,892
19년 전 조회 2,426
19년 전 조회 2,306
19년 전 조회 3,030
19년 전 조회 3,306
19년 전 조회 2,509
19년 전 조회 2,277
19년 전 조회 2,338
19년 전 조회 2,011