How to get jQuery pop to disappear again?
How do I get my jQuery pop-up to disappear again when "approvals" is clicked again?
$(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=versionles开发者_C百科s&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();
});
});
$(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();
});
Just use toggle
instead of click
:
$('a.approvals').toggle(function(e) {
...same code...
Live test case.
精彩评论