Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

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


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

I particularly like your++ short functional solution.

As for the IE problem… it seems it is more averse to the remove of the original node (also implicite in the original solution with insertBefore.)

So here is a workaround for the IE, avoiding the remove by inserting a cloneNode and display:none the original node.

<script type="text/javascript"> ( function() { var td = document.getElementById( 'nodelet_container' ).parentNode +; var tr = td.parentNode; tr.insertBefore( td.cloneNode(true), tr.firstChild ); td.style.display= "none"; } )(); </script>

This being a workaround has a shortcoming: The script interferes (aborts) the cloneNode, effectively cutting the nodelet tower under "Free Nodelet" at its base. So the "Free Nodelet" has to be the last (highest number) in your nodelet settings.

Mixed users (FF/IE/...) might use this out of the box, or can use a browser switch as in:

<script type="text/javascript"> ( function() { 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>

also avoiding the free nodelet cut in non-IE.

Replies are listed 'Best First'.
Re^5: Free Nodelet Hack: Nodelets on the left
by Argel (Prior) on Nov 09, 2006 at 20:41 UTC
    Hmm, I tried both under IE6 and I only see the XP nodelet and the top of the freenodelet (i.e. the title cell is fine but body cell is empty and compressed vertically). I must say I have new respect for those of you dealing with browser differences!!
      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.

        Maybe that problem can be eliminated by having the script called from onload.
        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!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found