简体   繁体   中英

SharePoint: jQuery toggle removing all SharePoint top divs, leaves space on bottom of web page?

So I have a jquery toggle event on a button for a SharePoint 2010 page. If clicked it just hides the SharePoint constructs:

$('#s4-topheader2,#s4-titlerow,#RibbonContainer,#s4-ribbonrow').toggle(500);

works fine, but after it is used the web page doesn't reach to the bottom of the page anymore? only after the top divs are brought back. So I am guessing there is a little piece I could add to get around this? why is this the case?

Your code works fine for me in IE and Chrome but if you want to re-size s4-workspace manually you should re-size after the animation has finished like:

$('#s4-topheader2,#s4-titlerow,#RibbonContainer,#s4-ribbonrow').toggle(500, function(){
    $('#s4-workspace').height($(window).height());
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM