2014-06-12 3 views
1

잘 작동하는 전체 테이블 행을 선택하려면 다음 javascript를 사용하고 있습니다.전체 테이블 행 위로 가기 팝업 선택

<script type="text/javascript"> 
$(function() 
{ 

    $('#link-table td:first-child').hide(); 

    $('#link-table tr').hover(function() 
    { 
    $(this).toggleClass('Highlight'); 
    }); 


    $('#link-table tr').click(function() 
    { 
    location.href = $(this).find('td a').attr('href'); 
    }); 
}); 

지금 내가 Top up Popop에서 선택한 행의 링크를 열려는하지만, href을 조정하는 것은 작동하지 않습니다.

내가 생각하기에, 나는 location.href = $(this).find('td a').attr('href');에서 뭔가를 조정해야한다고 생각하지만 어떻게해야할지 모르겠다. .

+0

를 해결할 것입니다; –

+0

location.href = $ (this) .find ('td> a'). attr ('href'); 변경되지는 않지만 팝업이 아닌 새 페이지에서 열립니다. – user3733945

답변

0

이 코드는 다음과 같이 location.href = $ (이) .find ('TD> A') ATTR ('HREF')를 시도하여 문제

$(this).find('td a').click(); 
+0

왜 문제가 해결 될까요? 설명을 추가하십시오 – sevenseacat

+0

"상단 IP 팝업"을 이미 적용한 앵커 태그에서 click 이벤트가 발생합니다. –

+0

는 location.href = $ (this) .find ('td a')를 대체합니다. attr ('href'); $ (this) .find ('td a'). click(); –