인 스 턴 스 (이벤트 거품 방지 이벤트. stopPropagation () 사용 하기;)

2319 단어 Propagation
         http://uc.webdev.lesongapp.cn/recruit_shaoyang/
click click
function showMoreInfo(){ var infoListItemNode = $('#search_results_container .results-list li'); infoListItemNode.click(function(e){ var thisNode = $(this), networkSectionNode = thisNode.find('.network-info-section'); //e.stopPropagation(); , if(networkSectionNode.is(':hidden')){ showNetworkUI(thisNode); } else { networkSectionNode.slideUp('slow'); } }); } function showNetworkUI(selection_id){ var parentNode = $(selection_id), networkDetailsSection = parentNode.find('.network-details'); parentNode.find('.network-info-section').slideDown('slow'); //showWeiboContent(networkDetailsSection); parentNode.find('.sns-item').each(function(){ var thisNode = $(this); thisNode.click(function(e){ e.preventDefault(); e.stopPropagation(); networkDetailsSection.empty(); $.log(networkDetailsSection.children().length); if(thisNode.hasClass('sina-weibo')){ showWeiboContent(networkDetailsSection); } else if (thisNode.hasClass('tx-weibo')){ showTXWeiboContent(networkDetailsSection); } else if (thisNode.hasClass('linkedin')){ showLinkedInContent(networkDetailsSection); } else if (thisNode.hasClass('renren')){ showRenrenContent(networkDetailsSection); } else if (thisNode.hasClass('kaixin')){ showKaixinContent(networkDetailsSection); } }); }); }

좋은 웹페이지 즐겨찾기