I've done this very thing using the Free Nodelet. First, turn on the Free Nodelet under your Nodelet Settings. Then go to your User Settings and enter the following into the Free Nodelet box near the bottom. It results in a link labeled "Toggle Page View" being added to the top of the page near the "print," "w/replies," and "xml" links. Click that link and the sidebar disappears. I usually use it to minimize horizontal scrolling if someone makes a really long line somewhere in a thread. This is based on the code found at this thread.
<script type="text/javascript">
var nodelet_state = 'block';
var lb = "\x5B";
var rb = "\x5D"
function add_toggle_link() {
var spn = document.createElement('span');
var rpn = document.createTextNode(' ( ');
var txt = document.createTextNode( 'Toggle Page View' );
var lpn = document.createTextNode(' )');
var lnk = document.createElement('a');
lnk.href = "javascript:toggle_nodelets()";
lnk.appendChild(txt);
var tbl = document.getElementById('titlebar-bottom');
var spns = tbl.getElementsByTagName('span');
var oldspn;
var i = 0;
while (spns.item(i)) {
if (spns.item(i).getAttribute('class') == "addlinks") {
oldspn = spns.item(i);
break;
}
i++;
}
spn.appendChild(rpn);
spn.appendChild(lnk);
spn.appendChild(lpn);
oldspn.appendChild(spn);
}
function toggle_nodelets() {
nodelet_state = (nodelet_state != 'none') ? 'none' : 'block';
var elements = document.getElementsByTagName('table');
var elnum;
var content_width = (nodelet_state == 'none') ? '100%' : '80%';
document.getElementById('monkbar').style.display = nodelet_state;
var tds = document.getElementsByTagName('td');
for (tnum = 0; tnum < tds.length; tnum++) {
var td = eval("tds" + lb + "tnum" + rb);
if (td.className == 'main_content') {
td.style.width = content_width;
break;
}
}
for (elnum = 0; elnum < elements.length; elnum++) {
var el = eval("elements" + lb + "elnum" + rb);
if (el.className == 'nodelet_container') {
el.style.display = nodelet_state;
break;
}
}
}
add_toggle_link();
</script>
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|