Du ser en gammel version af denne side. Se den nuværende version.

Sammenlign med nuværende Vis sidehistorik

Version 1 Næste »

This hides the Page Title

Name

hide-sidebar

Macro Body Processing

No Macro Body

Usage

{hide-sidebar}

Closely related to Confluence User Macro: hide-comments and Confluence User Macro: hide-metadata

 

Code

## @noparams

<script>
// Find out the initial state of the sidebar and set a cookie

jQuery.cookie("showsidebar",AJS.$("div#splitter-sidebar").width(), {expires:5});

//If the sidebar is visible, hide it and the split bar...

if (AJS.$("div#splitter-sidebar").width() > 0) {
AJS.$(".vsplitbar").hide();
AJS.$("div#splitter-sidebar").width(0);

// ...then change the width and position of the content

AJS.$('#splitter-content').css({'width':'100%', 'left':'0'});
};

// The unload function runs when the user navigates away from the page

jQuery(window).unload(function() {

// Read the cookie to find out where the sidebar was originally

var origstate = jQuery.cookie("showsidebar");

// If the sidebar is now hidden and it wasn't originally,
// Click the button

if (AJS.$("div#splitter-sidebar").width() != 300 && origstate == 300) {
AJS.$("#splitter-button").click();
};

// Then delete the local cookie

jQuery.cookie("showsidebar", null);
});
</script>


  • Ingen etiketter