다음은 내 코드입니다. 콘텐츠에 따라 li 태그를 숨기고 싶습니다.예 : 문자열 비교
dom.find('ul#overlay_opt li').click(function(){
if($(this).attr('class') != 'deactive'){
var content = $(this).text();
if(content == 'none') dom.find('#secondary_para').hide();
else dom.find('#secondary_para').html($(this).text()).show();
}
});
내 HTML은
<ul id="overlay_opt">
<li class="deactive">none</li>
<li>Requests</li>
<li>Impressions</li>
<li>Clicks</li>
<li>Earnings</li>
</ul>
문제, 즉 변수이고, 문자열 비교가 일어나고있다.
즉 false로 실행할 때마다 "if (content == 'none')"입니다.
라이브 데모를 제공 할 수 있습니까? –
콘텐츠에 경고()를하거나 파이어 버그와 같은 디버거로 해당 변수를 검사하면 어떻게됩니까? – BobbyShaftoe
라이브 데모가 불가능합니다. 호스팅 공간을 소유하고 있지 않지만 스크린 샷을 제공 할 수 있습니다. 아래 링크가 있습니다. http://www.freeimagehosting.net/uploads/65dde35e6c.gif – vinay