Node.js 드롭다운 메뉴 효과
이 글에서는 참고할만한 가치가 있는 js의 드롭다운 메뉴 효과 구현 사례를 주로 소개합니다.
렌더링:
코드는 다음과 같습니다.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> *{ margin: 0; padding: 0; } body { width: 460px; margin: 0 auto; font-family: "微软雅黑"; } .search{ height: 23px; line-height: 23px; border-bottom: 1px solid #d4d4d4; font-weight: 600; } .search img{ float: left; display: inline-block; margin-top: 5px; } .search span{ float: left; font-size: 14px; margin-left: 4px; } .content1{ height: 254px; width: 100%; background: #f5f5f5; border-top: 1px solid #eaeaea; padding-top: 10px; } .content1 .content1_p{ width: 90%; height: 43px; margin: 5px auto; } .left{ width: 30%; height: 43px; border: 1px solid #eaeaea; font-size: 14px; text-align: center; line-height: 43px; float: left; } .right{ width: 68%; height:43px; border: 1px solid #eaeaea; font-size: 14px; text-align: center; line-height: 43px; float: left; background: #fff; margin-left: 3px; } .right .right_select{ display: inline-block; width: 90%; height: 20px; border: none; border: 1px solid #a4bed4; text-align: center; direction: center; } .right_select option{ text-align: center; } .hecha{ text-align: center; margin-top: 15px; } .jdcxx{ height: 146px; font-size: 14px; background: #ebebeb; background-size:cover; padding-top: 20px; } .jdcxx p,.jdcsyrxx p{ margin-left: 20px; font-weight: 600; line-height: 33.6px; font-size: 14px; } .jdcxx .xx,.jdcsyrxx .xx{ font-weight: 100; } .jdcsyrxx{ margin-top: 20px; padding-top: 20px; height: 146px; font-size: 20px; background:#ebebeb; background-size:cover; } .hcr,.hcsj{ height: 30px; font-size: 14px; line-height: 30px; border-bottom: 1px solid #d4d4d4; } .hcr_left{ display: block; float: left; height: 28px; width: 2px; margin-top: 1px; background: #226ed2; } .zc{ width: 100px; display: block; float: left; text-align: right; margin-left: 10px; margin-right: 10px; } .xm,.sj{ font-weight: 600; } .xiala_p{ top: 33px; display: none; z-index: 600; border: 1px solid #A4BED4; width: 253px; left: 13px; } .xiala_input{ line-height: 21px; width: 253px; border: none; outline: none; margin: 0; text-align: center; cursor: default; background: #fff; color: #000; } .xiala_input:hover{ background: #a4bed4; } </style> <link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_8q2l5tghvcvm42t9.css "/> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> </head> <body> <header> <p class="search"> <img src="/static/imghw/default1.png" data-src="img/img_09.png" class="lazy" style="max-width:90%" / alt="Node.js 드롭다운 메뉴 효과" > <span>查询</span> </p> </header> <p class="content1"> <p class="content1_p"> <p class="left"> 号牌种类: </p> <p class="right" style="position: relative;"> <input type="text" name="" id="" readonly value="小型汽车号牌" class="right_select"/> <span style="position: absolute;right: 18px;top: 2px;font-size: 10px; color: #a4bed4;" class="xialaan icon-icon09 iconfont" ></span> <p class="xiala_p" style="position: absolute;top;line-height: 20px;" > <input type="text" class="xiala_input" readonly name="" id="" value="小型汽车号牌" /> <input type="text" class="xiala_input" readonly name="" id="" value="大型汽车号牌" /> <input type="text" class="xiala_input" readonly name="" id="" value="中型汽车号牌" /> </p> </p> </p> <p class="content1_p"> <p class="left"> 车牌号码: </p> <p class="right" style="position: relative;"> <input type="text" name="" id="" readonly value="鲁" class="right_select"/> <span style="position: absolute;right: 18px;top: 2px;font-size: 10px; color: #a4bed4;" class="xialaan icon-icon09 iconfont" ></span> <p class="xiala_p" style="position: absolute;top;line-height: 20px;" > <input type="text" class="xiala_input" readonly name="" id="" value="晋" /> <input type="text" class="xiala_input" readonly name="" id="" value="京" /> <input type="text" class="xiala_input" readonly name="" id="" value="豫" /> </p> </p> </p> <p class="content1_p"> <p class="left"> </p> <p class="right" style="position: relative;"> <input type="text" name="" id="" value="A" readonly class="right_select"/> <span style="position: absolute;right: 18px;top: 2px;font-size: 10px; color: #a4bed4;" class="xialaan icon-icon09 iconfont" ></span> <p class="xiala_p" style="position: absolute;top;line-height: 20px;" > <input type="text" class="xiala_input" readonly name="" id="" value="A" /> <input type="text" class="xiala_input" readonly name="" id="" value="B" /> <input type="text" class="xiala_input" readonly name="" id="" value="C" /> </p> </p> </p> </p> <script type="text/javascript"> var xialakuang = $(".xialaan"); var right_select = $(".right_select"); var xiala_p = $(".xiala_p") for( var i=0;i<xialakuang.length;i++ ){ xialakuang[i].index = i; var onOff = true; var This =i; xialakuang[i].onclick = function(){ if(onOff) { for( var j=0;j<xiala_p.length;j++ ){ if( this.index == j ){ xiala_p[j].style.display = 'block'; var xiala_input = xiala_p[j].getElementsByClassName("xiala_input"); if(j==0){ for(var k=0;k<xiala_input.length;k++){ xiala_input[k].index = k; xiala_input[k].onclick=function(){ var value = xiala_input[this.index].value; right_select[0].value=value; $(".xiala_p").css("display", "none") } } } if(j==1){ for(var k=0;k<xiala_input.length;k++){ xiala_input[k].index = k; xiala_input[k].onclick=function(){ var value = xiala_input[this.index].value; right_select[1].value=value; $(".xiala_p").css("display", "none") } } } if(j==2){ for(var k=0;k<xiala_input.length;k++){ xiala_input[k].index = k; xiala_input[k].onclick=function(){ var value = xiala_input[this.index].value; right_select[2].value=value; $(".xiala_p").css("display", "none") } } } }else{ xiala_p[j].style.display = 'none'; } } }else{ $(".xiala_p").css("display", "none") } onOff=!onOff } } for( var i=0;i<right_select.length;i++ ){ right_select[i].index = i; var onOff = true; var This =i; right_select[i].onclick = function(){ if(onOff) { for( var j=0;j<xiala_p.length;j++ ){ if( this.index == j ){ xiala_p[j].style.display = 'block'; var xiala_input = xiala_p[j].getElementsByClassName("xiala_input"); if(j==0){ for(var k=0;k<xiala_input.length;k++){ xiala_input[k].index = k; xiala_input[k].onclick=function(){ var value = xiala_input[this.index].value; right_select[0].value=value; $(".xiala_p").css("display", "none") } } } if(j==1){ for(var k=0;k<xiala_input.length;k++){ xiala_input[k].index = k; xiala_input[k].onclick=function(){ var value = xiala_input[this.index].value; right_select[1].value=value; $(".xiala_p").css("display", "none") } } } if(j==2){ for(var k=0;k<xiala_input.length;k++){ xiala_input[k].index = k; xiala_input[k].onclick=function(){ var value = xiala_input[this.index].value; right_select[2].value=value; $(".xiala_p").css("display", "none") } } } }else{ xiala_p[j].style.display = 'none'; } } }else{ $(".xiala_p").css("display", "none") } onOff=!onOff } } </script> </body> </html>
js 드롭다운 메뉴 효과와 관련된 더 많은 기사를 보려면 PHP 중국어 웹사이트를 주목하세요!

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











기사는 JavaScript 라이브러리 작성, 게시 및 유지 관리, 계획, 개발, 테스트, 문서 및 홍보 전략에 중점을 둡니다.

이 기사는 브라우저에서 JavaScript 성능을 최적화하기위한 전략에 대해 설명하고 실행 시간을 줄이고 페이지로드 속도에 미치는 영향을 최소화하는 데 중점을 둡니다.

프론트 엔드 개발시 프론트 엔드 열지대 티켓 인쇄를위한 자주 묻는 질문과 솔루션, 티켓 인쇄는 일반적인 요구 사항입니다. 그러나 많은 개발자들이 구현하고 있습니다 ...

이 기사는 브라우저 개발자 도구를 사용하여 효과적인 JavaScript 디버깅, 중단 점 설정, 콘솔 사용 및 성능 분석에 중점을 둡니다.

기술 및 산업 요구에 따라 Python 및 JavaScript 개발자에 대한 절대 급여는 없습니다. 1. 파이썬은 데이터 과학 및 기계 학습에서 더 많은 비용을 지불 할 수 있습니다. 2. JavaScript는 프론트 엔드 및 풀 스택 개발에 큰 수요가 있으며 급여도 상당합니다. 3. 영향 요인에는 경험, 지리적 위치, 회사 규모 및 특정 기술이 포함됩니다.

이 기사는 소스 맵을 사용하여 원래 코드에 다시 매핑하여 미니어링 된 JavaScript를 디버그하는 방법을 설명합니다. 소스 맵 활성화, 브레이크 포인트 설정 및 Chrome Devtools 및 Webpack과 같은 도구 사용에 대해 설명합니다.

Console.log 출력의 차이의 근본 원인에 대한 심층적 인 논의. 이 기사에서는 Console.log 함수의 출력 결과의 차이점을 코드에서 분석하고 그에 따른 이유를 설명합니다. � ...

엔트리 레벨 타입 스크립트 자습서를 마스터 한 후에는 TypeScript를 지원하고 JavaScript로 컴파일하는 IDE에서 자신의 코드를 작성할 수 있어야합니다. 이 튜토리얼은 TypeScript의 다양한 데이터 유형으로 뛰어납니다. JavaScript에는 NULL, UNDEFINED, BOOLEAN, 번호, 문자열, 기호 (ES6에 의해 소개 됨) 및 객체의 7 가지 데이터 유형이 있습니다. TypeScript는이 기반으로 더 많은 유형을 정의 하며이 튜토리얼은이 모든 튜토리얼을 자세히 다룹니다. 널 데이터 유형 JavaScript와 마찬가지로 Null in TypeScript
