Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^6: Free Nodelet Hack: Nodelets on the left

by pKai (Priest)
on Nov 09, 2006 at 21:07 UTC ( [id://583226]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Free Nodelet Hack: Nodelets on the left
in thread Nodelets on the left?

I tried both under IE6

The if (document.all) clause in #2 makes sure IE will run the same commands in both. So no surprise they behave identical.

I only see the XP nodelet and the top of the freenodelet

See my remark in the middle of the post ("shortcoming"). Freenodelet has to be your bottom nodelet to not loose other nodelets below it.

Replies are listed 'Best First'.
Re^7: Free Nodelet Hack: Nodelets on the left
by ikegami (Patriarch) on Nov 09, 2006 at 21:13 UTC
    Maybe that problem can be eliminated by having the script called from onload.
Re^7: Free Nodelet Hack: Nodelets on the left
by Argel (Prior) on Nov 09, 2006 at 22:00 UTC
    See my remark in the middle of the post ("shortcoming"). Freenodelet has to be your bottom nodelet to not loose other nodelets below it.

    Duh (slaps head)!! Does that mean nothing else can be in the freenodelet as well? I put several links in there as I do not like the layout contraints in the personal nodelet. Regardless, thanks for the IE tweak!!

      O. K., here is a fix, by separating definition of the function from its (then asynchronous) call.

      All precious freenodelet content should stay intact. Also freenodlet can be any node in the series here.

      <script type="text/javascript"> var doit = window.setInterval("FreeLeft()", 500); function FreeLeft() { window.clearInterval(doit); var td = document.getElementById('nodelet_container').parentNode; var tr = td.parentNode; if (document.all) { // IE tr.insertBefore( td.cloneNode(true), tr.firstChild ); td.style.display= "none"; } else { // w3c tr.insertBefore( td, tr.firstChild ); } } </script>
        Here's a much cleaner version (using onload instead of an arbitrary timer).
        <script type="text/javascript"> // Move nodelets to the left side. function move_nodelets_to_left() { var td = document.getElementById('nodelet_container').parentNode; var tr = td.parentNode; tr.insertBefore(td, tr.firstChild); } // Execute our snippets after the page is parsed. var old_onload = window.onload; window.onload = function() { if (old_onload != null) old_onload(); move_nodelets_to_left(); // Add other free nodelet functions here. }; </script>

        As you might have noticed, we no longer need the IE-specific code. The IE-specific code was needed because IE couldn't handle the changes we were doing to the DOM objects before it was done constructing them. But now that our script only executes after IE is completely done building the DOM tree, we can mess with the DOM tree as much as we want.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://583226]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-26 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found