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

    当“审批”再次被点击时,我如何让jQuery弹出消失?如何让jQuery pop消失?

    $(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 2011-02-16 18:18:36

    回答

    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

    假设您发布的代码段是正确的.. – 2011-02-16 18:25:49

    0

    只需使用toggle代替click

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

    Live test case

    相关问题