javascript
  • jquery
  • popup
  • 2011-02-16 5 views 1 likes 
    1

    "승인"을 다시 클릭하면 jQuery 팝업이 다시 사라지게하려면 어떻게해야합니까?jQuery 팝업이 다시 사라지게하려면 어떻게해야합니까?

    $(function() { 
    $('a.approvals').click(function(e) { 
        var html = '<div id="info">'; 
        html += '<a href ="http://www.coned.com/es/specs/gas/Section%20VII.pdf" div id="ConED"><img border= "0" src="con_edison_logo.png" /></a>'; 
        html += '<a href ="pdfs/2009_natl_grid_blue_book_web.pdf" div id="NationalGrid"><img border= "0" src="national_grid_logo.png" /></a>'; 
        html += '<a href ="http://database.ul.com/cgi-bin/XYV/template/LISEXT/1FRAME/showpage.html?name=JIFQ.MH46473&ccnshorttitle=Gas+Boosters&objid=1079858133&cfgid=1073741824&version=versionless&parent_id=1073988683&sequence=1" div id="ULLogo"><img border= "0" src="ul_logo_a.png" /></a>'; 
        html += '<a href ="http://license.reg.state.ma.us/pubLic/pl_products/pb_search.asp?type=G&manufacturer=Etter+Engineering+Company+Inc.&model=&product=&description=&psize=50" div id="MassGov"><img border= "0" src="massgovlogo.png" /></a>'; 
        html += '<div id="ApprovalsTxtpopup">With the exception of the UL-listing, the above approval agencies are region-specific, should your local agencies require any further documentation other than our UL-listing, please contact ETTER Engineering Toll Free 1-800-444-1962 for further assistance.</div>'; 
        html +=  '</div>'; 
        $('#Wrapper').append(html).children('#info').hide().fadeIn(400); 
    }, function() { 
        $('#info').remove(); 
    }); 
    

    });

    +0

    [jsFiddle] (http://jsfiddle.net) 데모를 제공 할 수 있습니까? 또한 HTML이 잘못되었습니다 (예 :''). – nyuszika7h

    답변

    0
    $(function() { 
    $('a.approvals').click(function(e) { 
        var html = '<div id="info">'; 
        html += '<a href ="http://www.coned.com/es/specs/gas/Section%20VII.pdf" div id="ConED"><img border= "0" src="con_edison_logo.png" /></a>'; 
        html += '<a href ="pdfs/2009_natl_grid_blue_book_web.pdf" div id="NationalGrid"><img border= "0" src="national_grid_logo.png" /></a>'; 
        html += '<a href ="http://database.ul.com/cgi-bin/XYV/template/LISEXT/1FRAME/showpage.html?name=JIFQ.MH46473&ccnshorttitle=Gas+Boosters&objid=1079858133&cfgid=1073741824&version=versionless&parent_id=1073988683&sequence=1" div id="ULLogo"><img border= "0" src="ul_logo_a.png" /></a>'; 
        html += '<a href ="http://license.reg.state.ma.us/pubLic/pl_products/pb_search.asp?type=G&manufacturer=Etter+Engineering+Company+Inc.&model=&product=&description=&psize=50" div id="MassGov"><img border= "0" src="massgovlogo.png" /></a>'; 
        html += '<div id="ApprovalsTxtpopup">With the exception of the UL-listing, the above approval agencies are region-specific, should your local agencies require any further documentation other than our UL-listing, please contact ETTER Engineering Toll Free 1-800-444-1962 for further assistance.</div>'; 
        html +=  '</div>'; 
        $('#Wrapper').append(html).children('#info').hide().fadeIn(400); 
    }, function() { 
        $('#info').remove(); 
        $('#Wrapper').children('#info').hide(); 
    }); 
    
    +0

    게시 한 스 니펫이 올바른 것으로 가정합니다. –

    0

    그냥 click 대신 toggle를 사용

    $('a.approvals').toggle(function(e) { 
        ...same code... 
    

    Live test case합니다.

    관련 문제