페이지의 다른 곳을 클릭하여 DIV를 숨깁니다 (자주 사용)
12368 단어 웹 프런트엔드 학습
<html lang="en">
<head>
<meta charset="UTF-8" />
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js">script>
<title>Documenttitle>
<script type="text/javascript">
$(function() {
function stopFunc(e) {
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
}
document.onclick = function(e) {
$(".options").css('display', 'none');
}
$(".more").click(function(e) {
$(".options").css('display', 'block');
e = e || event;
stopFunc(e);
})
$(".options").click(function(e) {
e = e || event;
stopFunc(e);
})
})
script>
<style type="text/css">
.more {
text-decoration: none;
}
.options {
position: absolute;
display: none;
left: 10px;
top: 46px;
background: #fff;
width: 128px;
border: red solid 1px;
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
}
.options a {
display: block;
line-height: 24px;
height: 24px;
padding-left: 10px;
color: #666;
text-decoration: none;
}
.options a:hover {
background: red;
}
style>
head>
<body>
<div id="main" style="position: relative;">
<a href="javascript:void(0)" target="_blank" class="more"> a>
<div class="options">
<a href="/ar">العربيةa>
<a href="/de">Deutscha>
<a href="/es">Española>
<a href="/fa">فارسیa>
<a href="/fr">Françaisa>
<a href="/he">עבריתa>
<a href="/hi">हिन्दीa>
<a href="/it">Italianoa>
<a href="/ja"> a>
<a href="/nl">Nederlandsa>
<a href="/pl">Polskia>
<a href="/pt">Portuguêsa>
<a href="/ro">Românăa>
<a href="/ru">Русскийa>
<a href="/th">ภาษาไทยa>
<a href="/tr">Türkçea>
<a href="/zh"> a>
<a href="/en">Englisha>
div>
div>
body>
html>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
[웹 전단] js json 중계수, 그룹 중계 json, 문자열 중계수텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.