4 HTML5 불꽃놀이 특수 효과 코드< /제목> 5 6 <"/><meta property="og:local" content="ko"> <meta property="og:title" content="JQuery와 html+css는 불꽃놀이를 시작하기 위해 마우스 클릭을 구현합니다.-JS 튜토리얼-php.cn"> <meta property="og:description" content="1 <!DOCTYPE html> 2 <html> 3 <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4 <title>HTML5 불꽃놀이 특수 효과 코드< /제목> 5 6 <"> <meta property="og:url" content="https://m.php.cn/ko/faq/369620.html"> <meta property="og:image" content="https://m.php.cn/static/images/logo.png"> <meta property="og:site_name" content="php.cn"> <meta property="og:type" content="website"> <link rel="canonical" href="https://www.php.cn/ko/faq/369620.html"/> <link rel="alternate" hrefLang="zh-cn" href="https://m.php.cn/zh/faq/369620.html" /> <link rel="alternate" hrefLang="en" href="https://m.php.cn/faq/369620.html" /> <link rel="alternate" hrefLang="zh-tw" href="https://m.php.cn/zh-tw/faq/369620.html" /> <link rel="alternate" hrefLang="ja" href="https://m.php.cn/ja/faq/369620.html" /> <link rel="alternate" hrefLang="ko" href="https://m.php.cn/ko/faq/369620.html" /> <link rel="alternate" hrefLang="ms" href="https://m.php.cn/ms/faq/369620.html" /> <link rel="alternate" hrefLang="fr" href="https://m.php.cn/fr/faq/369620.html" /> <link rel="alternate" hrefLang="de" href="https://m.php.cn/de/faq/369620.html" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=1" /><meta name="applicable-device" content="mobile" /><link rel="stylesheet" href="/static/css/style.css?4.5.31"><link href="/static/front/mobcss/newphpcommon.css?1.1" type="text/css" rel="stylesheet"/><link href="/static/front/mobcss/swiper.min.css" type="text/css" rel="stylesheet"/><link href="/static/front/mobcss/newphp.css?1.2" type="text/css" rel="stylesheet"/><link href="/static/css/global.css" type="text/css" rel="stylesheet"/><link href="/static/layui/css/layui.css" type="text/css" rel="stylesheet"/><link href="/static/mobcss/mobindex3.css" type="text/css" rel="stylesheet"/><script src="/static/front/mobjs/jquery-1.6.1.min.js"></script><script src="/static/front/mobjs/swiper.min.js"></script><script src="/static/front/mobjs/newphpcommon.js"></script><link rel="canonical" href="https://www.php.cn/ko/faq/369620.html"/> <link rel="alternate" hrefLang="zh-cn" href="https://m.php.cn/zh/faq/369620.html" /> <link rel="alternate" hrefLang="en" href="https://m.php.cn/faq/369620.html" /> <link rel="alternate" hrefLang="zh-tw" href="https://m.php.cn/zh-tw/faq/369620.html" /> <link rel="alternate" hrefLang="ja" href="https://m.php.cn/ja/faq/369620.html" /> <link rel="alternate" hrefLang="ko" href="https://m.php.cn/ko/faq/369620.html" /> <link rel="alternate" hrefLang="ms" href="https://m.php.cn/ms/faq/369620.html" /> <link rel="alternate" hrefLang="fr" href="https://m.php.cn/fr/faq/369620.html" /> <link rel="alternate" hrefLang="de" href="https://m.php.cn/de/faq/369620.html" /> <script> var canshu = { SeeMore:'더보기', FoldUp:'접', Choice:'언어', wait:'불러오는 중입니다. 기다려 주세요~', LoginFirst:"먼저 로그인을 해주세요", needKeyword:'키워드 검색을 입력하세요', emailPhoneError:'정확한 전화번호나 이메일 주소를 입력해주세요', missPwd:'비밀번호를 입력해주세요', emailError:'올바른 이메일 주소를 입력해주세요', VerCode:"인증 코드를 입력 해주세요", getCode:'배상', pwdError:'잘못된 비밀번호 형식', TwoPassNotMatch:'두 개의 비밀번호가 일치하지 않습니다', Bindemail:'이메일 바인딩', resetpassword:'암호를 재설정', ConfirmPass:'비밀번호 확인', pwdCheck:'6~18자의 문자 또는 숫자를 입력하세요.', Editinfor: '개인정보 수정', trimContent:'내용을 입력해주세요', titleCheck:'제목은 5단어 이상이어야 합니다.', choiceLang:'언어 분류를 선택하세요.', Secondreply:'회신하다', NetWorkError:'네트워크 오류가 발생했습니다. 나중에 다시 시도해 주세요.', keywordSearch:'키워드 검색을 입력하세요', all_lang_string:'zh|en|zh-tw|ja|ko|ms|fr|de', Next:'다음', Previous:'이전의' }; </script><!-- Google Tag Manager --><script> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl; f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-WWVXRJPW'); </script><!-- End Google Tag Manager --><!-- Google tag (gtag.js) --><script async src="https://www.googletagmanager.com/gtag/js?id=G-H42EVCYBJC"></script><script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-H42EVCYBJC'); </script><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5902227090019525" crossorigin="anonymous"></script><!--<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6267705206177514" crossorigin="anonymous"></script>--><script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"WebSite","url":"https:\/\/m.php.cn\/ko\/","potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/m.php.cn\/ko\/search?word={search_term_string}"},"query-input":"required name=search_term_string"}}</script><meta property="article:author" content="PHP中文网" /><meta property="article:published_first" content=",https://www.php.cn/faq/369620.html" /><link rel="stylesheet" href="/static/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css?1"><link rel="stylesheet" href="/static/ueditor/third-party/SyntaxHighlighter/shCoreDefault1.css"><link href="/static/mobcss/newphp.css" type="text/css" rel="stylesheet"/><script src="/static/ueditor/third-party/SyntaxHighlighter/shCore.js"></script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script><script> var xnb_name = 'Virtual currency'; </script><script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","headline":"JQuery와 html+css는 불꽃놀이를 시작하기 위해 마우스 클릭을 구현합니다.","description":"1 <!DOCTYPE html> 2 <html> 3 <head><meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"> 4 <title>HTML5 불꽃놀이 특수 효과 코드< \/제목> 5 6 <","datePublished":"2017-06-20T09:36:00+8:00","author":{"url":"https:\/\/m.php.cn\/ko\/member\/1.html","name":"PHP中文网"},"mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/m.php.cn\/ko\/faq\/369620.html"},"url":"https:\/\/m.php.cn\/ko\/faq\/369620.html","articleBody":"<div class=\"cnblogs_code\">\n으아악\n<\/div>\n<p>네티즌 여러분! 이번 방학에 선생님께서 보내주신 내용이라 이해가 안되는 부분이 있어서 정말 죄송합니다! 예전 선생님을 찾아 물어보세요. 은퇴한 지 오래됐지만!!<\/p>"}</script><script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/m.php.cn\/ko\/","name":"집"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/m.php.cn\/ko\/web-designer.html","name":"웹 프론트엔드"}},{"@type":"ListItem","position":3,"item":{"@id":"https:\/\/m.php.cn\/ko\/js-tutorial.html","name":"JS 튜토리얼"}},{"@type":"ListItem","position":4,"item":{"@id":"https:\/\/m.php.cn\/ko\/faq\/369620.html","name":"JQuery와 html+css는 불꽃놀이를 시작하기 위해 마우스 클릭을 구현합니다."}}]}</script></head><body data-commit-time="2023-12-28T14:50:12+08:00" class="body2_2"><link rel="stylesheet" type="text/css" href="/static/csshwm/m_stylehw.css"><header><div class="head"><div class="haed_left"><div class="haed_logo"><a href="https://m.php.cn/ko/" title="PHP 중국어 웹사이트" class="haed_logo_a"><img src="/static/imghwm/logo.png" alt="PHP 중국어 웹사이트" class="haed_logoimg"></a></div></div><div class="search_div search_div_top2"><input id="key_words" class="search-input" type="text" autocomplete="off" name="keywords" required="required" placeholder="Block,address,transaction,news" value="" onkeydown="if (event.keyCode == 13) searchs('ko')"/><a onclick="searchs('ko')" href="javascript:;" title="찾다"><img onerror="this.onerror=''; this.src='static/imghwm/default1.png'" src="/static/imghwm/find.png" alt="찾다"></a></div><div class="head_right"><button type="button" class="layui-btn layui-btn-primary headerlan headlanmax lan1" id="lan1sp" lay-on="test-offset-r"><img src="/static/imghwm/m_menu.png" alt=""></button><div id="m_menu" class="m_menu" style="display: none;"><div class="m_editormain12main_top"><img src="/static/imghwm/logo.png" alt="logo"><a href="javascript:;" class="m_editormain12main_topi" id="m_editormain12main_topi_sp"><i class="layui-icon layui-icon-close"></i></a></div><div class="layui-panel m_menu_main"><ul class="layui-menu" id="demo-menu"><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">지역 사회<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/article.html" title="조항">조항</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/faq/zt" title="주제">주제</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/wenda.html" title="Q&A">Q&A</a></div></li></ul></li><li class="layui-menu-item-divider"></li><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">배우다<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/course.html" title="강의">강의</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/dic/29.html" title="프로그래밍 사전">프로그래밍 사전</a></div></li></ul></li><li class="layui-menu-item-divider"></li><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">도구 라이브러리<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/toolset/development-tools" title="개발 도구">개발 도구</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/toolset/website-source-code" title="웹사이트 소스 코드">웹사이트 소스 코드</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/toolset/php-libraries" title="PHP 라이브러리">PHP 라이브러리</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/toolset/js-special-effects" title="JS 특수 효과">JS 특수 효과</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/toolset/website-materials" title="웹사이트 자료">웹사이트 자료</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/toolset/extension-plug-ins" title="확장 플러그인">확장 플러그인</a></div></li></ul></li><li class="layui-menu-item-divider"></li><li lay-options="{id: 100}"><div class="layui-menu-body-title m_menus_oth"><a href="https://m.php.cn/ko/ai" title="AI 도구">AI 도구</a></div></li><li class="layui-menu-item-divider"></li><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">여가<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/game" title="게임 다운로드">게임 다운로드</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="https://m.php.cn/ko/mobile-game-tutorial/" title="게임 튜토리얼">게임 튜토리얼</a></div></li></ul></li><li class="layui-menu-item-divider"></li></ul></div><!-- <div class="m_menu_button">--><!-- <a href="javascript:;" title="singup">Create an account</a>--><!-- </div>--><div class="m_menu_button m_menu_button_login"><a href="https://m.php.cn/ko/login" title="Login">Log in</a></div><div class="m_menu_button m_menu_button_lang"><button type="button" class="layui-btn layui-btn-primary headerlan headlanmax lan1" id="lan1" lay-on="page2">한국어<i class="layui-icon layui-icon-triangle-d"></i></button></div></div><div class="m_menu_lang" id="m_menu_lang" style="display: none;"><div class="m_editormain12main_top"><img src="/static/imghwm/logo.png" alt="logo"><a href="javascript:;" class="m_editormain12main_topi" id="m_editormain12main_topi_lan"><i class="layui-icon layui-icon-close"></i></a></div><div class="m_menu_lang_main"><a href="javascript:setlang('zh-cn');" class="m_menu_lang_mains">简体中文<span>zh-cn</span></a><a href="javascript:setlang('en');" class="m_menu_lang_mains">English<span>en</span></a><a href="javascript:setlang('zh-tw');" class="m_menu_lang_mains">繁体中文<span>zh-tw</span></a><a href="javascript:setlang('ja');" class="m_menu_lang_mains">日本語<span>ja</span></a><a href="javascript:;" class="m_menu_lang_mains">한국어<span>ko</span></a><a href="javascript:setlang('ms');" class="m_menu_lang_mains">Melayu<span>ms</span></a><a href="javascript:setlang('fr');" class="m_menu_lang_mains">Français<span>fr</span></a><a href="javascript:setlang('de');" class="m_menu_lang_mains">Deutsch<span>de</span></a></div></div></div></div></header><script> document.getElementById('lan1sp').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'block'; } }); document.getElementById('m_editormain12main_topi_sp').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'none'; } }); document.getElementById('lan1').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu_lang'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'block'; } }); document.getElementById('m_editormain12main_topi_lan').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu_lang'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'none'; } }); </script><main class="m_phpTopic_Details m_phpArticle_Details"><div class="Article_Details_main1M"><div class="phpgenera_Details_mainL1"><a href="https://m.php.cn/ko/" title="집" class="phpgenera_Details_mainL1a">집</a><img class="lazy" data-src="/static/imghwm/top_right.png" src="/static/imghw/default1.png" alt="" /><a href="https://m.php.cn/ko/web-designer.html" class="phpgenera_Details_mainL1a">웹 프론트엔드</a><img class="lazy" data-src="/static/imghwm/top_right.png" src="/static/imghw/default1.png" alt="" /><a href="https://m.php.cn/ko/js-tutorial.html" class="phpgenera_Details_mainL1a">JS 튜토리얼</a><img class="lazy" data-src="/static/imghwm/top_right.png" src="/static/imghw/default1.png" alt="" /><span>JQuery와 html+css는 불꽃놀이를 시작하기 위해 마우스 클릭을 구현합니다.</span></div><div class="Articlelist_txts"><div class="Articlelist_txts_info"><a href="" title="" class="Articlelist_txts_title">JQuery와 html+css는 불꽃놀이를 시작하기 위해 마우스 클릭을 구현합니다.</a><div class="Articlelist_txts_info_head"><div class="author_info"><a href="https://m.php.cn/ko/member/1.html" class="author_avatar"><img class="lazy" data-src="https://img.php.cn/upload/avatar/000/000/001/6251028808086368.png" alt="PHP中文网" src="/static/imghw/default1.png" alt="author avatar" onerror="this.onerror=''; this.src='/static/imghw/default1.png'"></a><div class="author_detail"><a href="https://m.php.cn/ko/member/1.html" class="author_name">PHP中文网</a></div></div></div><span class="Articlelist_txts_time">Jun 20, 2017 am 09:36 AM</span><div class="Articlelist_txts_infos"><span class="Articlelist_txts_infoss on">css</span><span class="Articlelist_txts_infoss ">html+css</span><span class="Articlelist_txts_infoss ">jquery</span><span class="Articlelist_txts_infoss ">성취하다</span><span class="Articlelist_txts_infoss ">딸깍 하는 소리</span><span class="Articlelist_txts_infoss ">생쥐</span></div></div></div><hr /><div class="article_main"><div class="cnblogs_code"> 으아악 </div> <p>네티즌 여러분! 이번 방학에 선생님께서 보내주신 내용이라 이해가 안되는 부분이 있어서 정말 죄송합니다! 예전 선생님을 찾아 물어보세요. 은퇴한 지 오래됐지만!!</p><p>위 내용은 JQuery와 html+css는 불꽃놀이를 시작하기 위해 마우스 클릭을 구현합니다.의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!</p></div><div class="wzconShengming_sp"><div class="bzsmdiv_sp">성명</div><div>본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.</div></div></div><div class="phpgenera_Details_mainL4"><div class="phpmain1_2_top"><a href="javascript:void(0);" class="phpmain1_2_top_title">관련 기사<img class="lazy" data-src="/static/imghwm/index2_title2.png" src="/static/imghw/default1.png" alt="" /></a></div><div class="phpgenera_Details_mainL4_info"><div class="phphistorical_Version2_mids"><a href="" title="jquery实现多少秒后隐藏图片" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/625fd0d77feb4966.jpg" alt="jquery实现多少秒后隐藏图片" src="/static/imghw/default1.png" /></a><a href="" title="jquery实现多少秒后隐藏图片" class="phphistorical_Version2_mids_title">jquery实现多少秒后隐藏图片</a><span class="Articlelist_txts_time">Apr 20, 2022 pm 05:33 PM</span><p class="Articlelist_txts_p">实现方法:1、用“$("img").delay(毫秒数).fadeOut()”语句,delay()设置延迟秒数;2、用“setTimeout(function(){ $("img").hide(); },毫秒值);”语句,通过定时器来延迟。</p></div><div class="phphistorical_Version2_mids"><a href="" title="jquery怎么修改min-height样式" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/625f894f55bb4931.jpg" alt="jquery怎么修改min-height样式" src="/static/imghw/default1.png" /></a><a href="" title="jquery怎么修改min-height样式" class="phphistorical_Version2_mids_title">jquery怎么修改min-height样式</a><span class="Articlelist_txts_time">Apr 20, 2022 pm 12:19 PM</span><p class="Articlelist_txts_p">修改方法:1、用css()设置新样式,语法“$(元素).css("min-height","新值")”;2、用attr(),通过设置style属性来添加新样式,语法“$(元素).attr("style","min-height:新值")”。</p></div><div class="phphistorical_Version2_mids"><a href="" title="axios与jquery的区别是什么" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/202204/20/2022042017133614950.jpg" alt="axios与jquery的区别是什么" src="/static/imghw/default1.png" /></a><a href="" title="axios与jquery的区别是什么" class="phphistorical_Version2_mids_title">axios与jquery的区别是什么</a><span class="Articlelist_txts_time">Apr 20, 2022 pm 06:18 PM</span><p class="Articlelist_txts_p">区别:1、axios是一个异步请求框架,用于封装底层的XMLHttpRequest,而jquery是一个JavaScript库,只是顺便封装了dom操作;2、axios是基于承诺对象的,可以用承诺对象中的方法,而jquery不基于承诺对象。</p></div><div class="phphistorical_Version2_mids"><a href="" title="jquery怎么在body中增加元素" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/62621b1eba2c0754.jpg" alt="jquery怎么在body中增加元素" src="/static/imghw/default1.png" /></a><a href="" title="jquery怎么在body中增加元素" class="phphistorical_Version2_mids_title">jquery怎么在body中增加元素</a><span class="Articlelist_txts_time">Apr 22, 2022 am 11:13 AM</span><p class="Articlelist_txts_p">增加元素的方法:1、用append(),语法“$("body").append(新元素)”,可向body内部的末尾处增加元素;2、用prepend(),语法“$("body").prepend(新元素)”,可向body内部的开始处增加元素。</p></div><div class="phphistorical_Version2_mids"><a href="" title="jquery中apply()方法怎么用" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/202204/24/2022042416093289813.jpg" alt="jquery中apply()方法怎么用" src="/static/imghw/default1.png" /></a><a href="" title="jquery中apply()方法怎么用" class="phphistorical_Version2_mids_title">jquery中apply()方法怎么用</a><span class="Articlelist_txts_time">Apr 24, 2022 pm 05:35 PM</span><p class="Articlelist_txts_p">在jquery中,apply()方法用于改变this指向,使用另一个对象替换当前对象,是应用某一对象的一个方法,语法为“apply(thisobj,[argarray])”;参数argarray表示的是以数组的形式进行传递。</p></div><div class="phphistorical_Version2_mids"><a href="" title="jquery怎么删除div内所有子元素" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/62613a5e18ff3213.jpg" alt="jquery怎么删除div内所有子元素" src="/static/imghw/default1.png" /></a><a href="" title="jquery怎么删除div内所有子元素" class="phphistorical_Version2_mids_title">jquery怎么删除div内所有子元素</a><span class="Articlelist_txts_time">Apr 21, 2022 pm 07:08 PM</span><p class="Articlelist_txts_p">删除方法:1、用empty(),语法“$("div").empty();”,可删除所有子节点和内容;2、用children()和remove(),语法“$("div").children().remove();”,只删除子元素,不删除内容。</p></div><div class="phphistorical_Version2_mids"><a href="" title="jquery怎么去掉只读属性" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/625ff3f389a61935.jpg" alt="jquery怎么去掉只读属性" src="/static/imghw/default1.png" /></a><a href="" title="jquery怎么去掉只读属性" class="phphistorical_Version2_mids_title">jquery怎么去掉只读属性</a><span class="Articlelist_txts_time">Apr 20, 2022 pm 07:55 PM</span><p class="Articlelist_txts_p">去掉方法:1、用“$(selector).removeAttr("readonly")”语句删除readonly属性;2、用“$(selector).attr("readonly",false)”将readonly属性的值设置为false。</p></div><div class="phphistorical_Version2_mids"><a href="" title="jquery on()有几个参数" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/6260ce9d51187782.jpg" alt="jquery on()有几个参数" src="/static/imghw/default1.png" /></a><a href="" title="jquery on()有几个参数" class="phphistorical_Version2_mids_title">jquery on()有几个参数</a><span class="Articlelist_txts_time">Apr 21, 2022 am 11:29 AM</span><p class="Articlelist_txts_p">on()方法有4个参数:1、第一个参数不可省略,规定要从被选元素添加的一个或多个事件或命名空间;2、第二个参数可省略,规定元素的事件处理程序;3、第三个参数可省略,规定传递到函数的额外数据;4、第四个参数可省略,规定当事件发生时运行的函数。</p></div></div><a href="https://m.php.cn/ko/web-designer.html" class="phpgenera_Details_mainL4_botton"><span>See all articles</span><img class="lazy" data-src="/static/imghwm/down_right.png" src="/static/imghw/default1.png" alt="" /></a></div><ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-6t+ed+2i-1n-4w" data-ad-client="ca-pub-5902227090019525" data-ad-slot="8966999616"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><div class="AI_ToolDetails_main4sR"><div class="phpgenera_Details_mainR3"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hottools2.png" src="/static/imghw/default1.png" alt="" /><h2>핫 AI 도구</h2></div><div class="phpgenera_Details_mainR3_bottom"><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/ai/undresserai-undress" title="Undresser.AI Undress"class="phpmain_tab2_mids_title"><h3>Undresser.AI Undress</h3></a><p>사실적인 누드 사진을 만들기 위한 AI 기반 앱</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/ai/ai-clothes-remover" title="AI Clothes Remover"class="phpmain_tab2_mids_title"><h3>AI Clothes Remover</h3></a><p>사진에서 옷을 제거하는 온라인 AI 도구입니다.</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/ai/undress-ai-tool" title="Undress AI Tool"class="phpmain_tab2_mids_title"><h3>Undress AI Tool</h3></a><p>무료로 이미지를 벗다</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/ai/clothoffio" title="Clothoff.io"class="phpmain_tab2_mids_title"><h3>Clothoff.io</h3></a><p>AI 옷 제거제</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/ai/ai-hentai-generator" title="AI Hentai Generator"class="phpmain_tab2_mids_title"><h3>AI Hentai Generator</h3></a><p>AI Hentai를 무료로 생성하십시오.</p></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/ko/ai">더보기</a></div></div></div><div class="phpgenera_Details_mainR4"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hotarticle2.png" src="/static/imghw/default1.png" alt="" /><h2>인기 기사</h2></div><div class="phpgenera_Details_mainR4_bottom"><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/1796780570.html" title="R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>2 몇 주 전</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/1796773439.html" title="Repo : 팀원을 부활시키는 방법" class="phpgenera_Details_mainR4_bottom_title">Repo : 팀원을 부활시키는 방법</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>4 몇 주 전</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/1796774171.html" title="헬로 키티 아일랜드 어드벤처 : 거대한 씨앗을 얻는 방법" class="phpgenera_Details_mainR4_bottom_title">헬로 키티 아일랜드 어드벤처 : 거대한 씨앗을 얻는 방법</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 몇 주 전</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/1796775427.html" title="스플릿 소설을이기는 데 얼마나 걸립니까?" class="phpgenera_Details_mainR4_bottom_title">스플릿 소설을이기는 데 얼마나 걸립니까?</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 몇 주 전</span><span>ByDDD</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/1796775336.html" title="R.E.P.O. 파일 저장 위치 : 어디에 있고 그것을 보호하는 방법은 무엇입니까?" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. 파일 저장 위치 : 어디에 있고 그것을 보호하는 방법은 무엇입니까?</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 몇 주 전</span><span>ByDDD</span></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/ko/article.html">더보기</a></div></div></div><div class="phpgenera_Details_mainR3"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hottools2.png" src="/static/imghw/default1.png" alt="" /><h2>뜨거운 도구</h2></div><div class="phpgenera_Details_mainR3_bottom"><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/toolset/development-tools/469" title="드림위버 CS6" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg" src="/static/imghw/default1.png" alt="드림위버 CS6" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/toolset/development-tools/469" title="드림위버 CS6" class="phpmain_tab2_mids_title"><h3>드림위버 CS6</h3></a><p>시각적 웹 개발 도구</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/toolset/development-tools/121" title="스튜디오 13.0.1 보내기" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg" src="/static/imghw/default1.png" alt="스튜디오 13.0.1 보내기" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/toolset/development-tools/121" title="스튜디오 13.0.1 보내기" class="phpmain_tab2_mids_title"><h3>스튜디오 13.0.1 보내기</h3></a><p>강력한 PHP 통합 개발 환경</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/toolset/development-tools/1545" title="Eclipse용 SAP NetWeaver 서버 어댑터" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/007/169165990824460.png" src="/static/imghw/default1.png" alt="Eclipse용 SAP NetWeaver 서버 어댑터" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/toolset/development-tools/1545" title="Eclipse용 SAP NetWeaver 서버 어댑터" class="phpmain_tab2_mids_title"><h3>Eclipse용 SAP NetWeaver 서버 어댑터</h3></a><p>Eclipse를 SAP NetWeaver 애플리케이션 서버와 통합합니다.</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/toolset/development-tools/1557" title="mPDF" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/003/169206948656118.png" src="/static/imghw/default1.png" alt="mPDF" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/toolset/development-tools/1557" title="mPDF" class="phpmain_tab2_mids_title"><h3>mPDF</h3></a><p>mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/ko/toolset/development-tools/660" title="Atom Editor Mac 버전 다운로드" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ed8cfa94c1a582.jpg" src="/static/imghw/default1.png" alt="Atom Editor Mac 버전 다운로드" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/ko/toolset/development-tools/660" title="Atom Editor Mac 버전 다운로드" class="phpmain_tab2_mids_title"><h3>Atom Editor Mac 버전 다운로드</h3></a><p>가장 인기 있는 오픈 소스 편집기</p></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/ko/ai">더보기</a></div></div></div><div class="phpgenera_Details_mainR4"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hotarticle2.png" src="/static/imghw/default1.png" alt="" /><h2>뜨거운 주제</h2></div><div class="phpgenera_Details_mainR4_bottom"><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/gmailyxdlrkzn" title="Gmail 이메일의 로그인 입구는 어디에 있나요?" class="phpgenera_Details_mainR4_bottom_title">Gmail 이메일의 로그인 입구는 어디에 있나요?</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>7318</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>9</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/java-tutorial" title="자바 튜토리얼" class="phpgenera_Details_mainR4_bottom_title">자바 튜토리얼</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>1625</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>14</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/cakephp-tutor" title="Cakephp 튜토리얼" class="phpgenera_Details_mainR4_bottom_title">Cakephp 튜토리얼</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>1349</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>46</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/laravel-tutori" title="라라벨 튜토리얼" class="phpgenera_Details_mainR4_bottom_title">라라벨 튜토리얼</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>1261</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>25</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/ko/faq/php-tutorial" title="PHP 튜토리얼" class="phpgenera_Details_mainR4_bottom_title">PHP 튜토리얼</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>1209</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>29</span></div></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/ko/faq/zt">더보기</a></div></div></div></div></main><ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="5027754603"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><footer><div class="footer"><div class="footertop"><img src="/static/imghwm/logo.png" alt=""><p>공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!</p></div><div class="footermid"><a href="https://m.php.cn/ko/about/us.html">회사 소개</a><a href="https://m.php.cn/ko/about/disclaimer.html">부인 성명</a><a href="https://m.php.cn/ko/update/article_0_1.html">Sitemap</a></div><div class="footerbottom"><p> © php.cn All rights reserved </p></div></div></footer><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '9']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><script>jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); // 通用函数,用于显示或隐藏元素 function toggleElementsDisplay(className, show) { const elements = document.getElementsByClassName(className); for (let i = 0; i < elements.length; i++) { elements[i].style.display = show ? "block" : "none"; } } // 绑定事件监听器 function bindEventListeners() { const toggleDisplay = (className, show, eventId) => { document.getElementById(eventId).addEventListener("click", (event) => { event.preventDefault(); toggleElementsDisplay(className, show); }); }; toggleDisplay("m_editormain12main", true, "fixed_tab_img"); toggleDisplay("m_editormain12main", false, "fixed_tab_topi"); toggleDisplay("m_editormain12main", false, "fixed_tab_close"); // 控制 m_menu 的显示和隐藏 toggleDisplay("m_menu", true, "lan1sp"); toggleDisplay("m_menu", false, "m_editormain12main_topi_sp"); // 控制 m_menu_lang 的显示和隐藏 toggleDisplay("m_menu_lang", true, "lan1"); toggleDisplay("m_menu_lang", false, "m_editormain12main_topi_lan"); } // 在页面加载完成后绑定事件监听器 window.onload = bindEventListeners; layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); // 获取关闭按钮 const closeButton = document.querySelector(".phpgenera_Details_mainR1_close"); // 获取容器元素 const container = document.querySelector(".phpgenera_Details_mainR1"); // 添加点击事件监听器 closeButton.addEventListener("click", (event) => { event.preventDefault(); // 阻止默认的<a>点击行为 container.style.display = "none"; // 隐藏容器 }); document.addEventListener("DOMContentLoaded", () => { // 动态获取所有滚动链接及隐藏目标元素 const links = [{ linkId: "fixed_tab_a1", targetId: "article_main_title1", hideElementId: "fixed_tab_titlelist", // 要隐藏的元素 ID }, { linkId: "fixed_tab_a2", targetId: "article_main_title2", hideElementId: "fixed_tab_titlelist", // 要隐藏的元素 ID }, { linkId: "fixed_tab_a3", targetId: "article_main_title3", hideElementId: "fixed_tab_titlelist", // 要隐藏的元素 ID }, { linkId: "fixed_tab_a4", targetId: "article_main_title4", hideElementId: "fixed_tab_titlelist", // 要隐藏的元素 ID }, ]; links.forEach(({ linkId, targetId, hideElementId }) => { const linkElement = document.getElementById(linkId); const targetElement = document.getElementById(targetId); const hideElement = document.getElementById(hideElementId); if (linkElement && targetElement) { linkElement.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认行为 // 隐藏指定元素 if (hideElement) { hideElement.style.display = "none"; // 也可以用其他方法隐藏,如 `visibility: hidden` } // 平滑滚动到目标元素 targetElement.scrollIntoView({ behavior: "smooth" }); }); } else { console.warn( `Link, target, or hide element not found: ${linkId}, ${targetId}, ${hideElementId}` ); } }); }); // 初始化菜单交互功能 document.addEventListener('DOMContentLoaded', function () { const menuGroupElements = document.querySelectorAll('.layui-menu-item-group'); menuGroupElements.forEach(menuItem => { menuItem.addEventListener('click', function (event) { // 防止子菜单点击触发父级事件 if (event.target.closest('.m_menusnames')) { return; } // 切换菜单状态 this.classList.toggle('layui-menu-item-down'); this.classList.toggle('layui-menu-item-up'); // 获取子菜单容器 const subMenuContainer = this.querySelector('.m_menusnames'); // 切换子菜单显示状态 if (subMenuContainer) { if (this.classList.contains('layui-menu-item-down')) { subMenuContainer.style.display = 'block'; this.querySelector('.layui-icon').classList.remove( 'layui-icon-down'); this.querySelector('.layui-icon').classList.add('layui-icon-up'); } else { subMenuContainer.style.display = 'none'; this.querySelector('.layui-icon').classList.remove('layui-icon-up'); this.querySelector('.layui-icon').classList.add('layui-icon-down'); } } }); }); }); </script></body></html>