0
내 코드는 태그를 클릭하면 checked
클래스의 요소를 보여줍니다.
라이브 페이지에서 ☐ tag-name
을 누르면 아무 일도 발생하지 않습니다.
jsfiddle에서 하나를 클릭하면 정상적으로 작동합니다.
Blogger에서 무슨 일이 일어나고 있는지, 잘못되었는지 알 수 없습니다.
누군가 나를 도와 드릴까요? 감사.Blogger - jQuery 출력이 없습니까?
Blogger live page, jsfiddle은 :
$('div.label').on('click', function(){
if ($(this).text().match("☐")) {
$('div.dhptable table.hptable').show();
$('div.label').each(function(){
$(this).text($(this).text().replace("☑", "☐"));
});
$(this).text($(this).text().replace("☐", "☑"));
$('table.hptable:not(.'+$(this).attr("id")+')').hide('slow');
} else {
$('div.dhptable table.hptable').show('slow');
$(this).text($(this).text().replace("☑", "☐"));
}
})
body {
width: 650px;
}
.hptable {
text-align:center;
vertical-align: middle;
margin: 12px;
display: inline-block;
}
.hptable td:hover {
background-color: #CEE9FF;
}
.cell {
vertical-align: middle;
width: 176px;
max-width: 177px;
/*height: 176px;
max-height: 177px;*/
text-align: center;
border: 1px solid #87CEEB !important;
background-color: #D9F9FF;
font-size: large;
font-weight: bold;
}
.hptable img {
vertical-align:middle;
max-width: 175px;
max-height: 175px;
}
div.muri.b textarea.muri {
width: 60px;
height: 30px;
}
div.lang {
display: inline-block;
border: 1px solid #D1D1FF;
padding: 1px;
border-radius: 2px;
}
.label {
display:inline-block;
background: #84E3FF;
position: relative;
}
.label:before {
content: '';
position: absolute;
top: 0; right: 0;
border-top: 11px solid white;
border-left: 11px solid #84E3FF;
width: 0;
}
.label:after {
content: '';
position: absolute;
bottom: 0; right: 0;
border-bottom: 11px solid white;
border-left: 11px solid #84E3FF;
width: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<hr /><b>TAG</b>:<div id='windows' class='label'> ☐ Windows </div> <div id='jquery' class='label'> ☐ jQuery </div> <div id='software' class='label'> ☐ Software </div> <div id='blogger' class='label'> ☐ Blogger </div>
<br />
<hr />
<div class='dhptable' style='text-align: left; vertical-align: middle;'>
<table class="hptable exc windows">
<tr><td class='null cell'>TAG: windows</td></tr></table>
<table class="hptable exc jquery">
<tr><td class='null cell'>TAG: jquery</td></tr></table>
<table class="hptable exc software">
<tr><td class='null cell'>TAG: software</td></tr></table>
<table class="hptable exc software">
<tr><td class='null cell'>TAG: software</td></tr></table>
<table class="hptable exc blogger">
<tr><td class='null cell'>TAG: blogger</td></tr></table>
<table class="hptable exc">
<tr><td class='null cell'>
</td></tr></table>
</div>
'.ready()'를 의미합니까? 방금 시도했는데 내 코드가 기다려야하는 문제가 아닐 수도 있습니다. – Louis55
'$ (function() {'는'$ (document) .ready (function() {'와 동일 함을 의미합니다. https://api.jquery.com/ready/ – Xzandro
오 세상에, 문자 인코딩에 문제가 있습니다. . – Louis55