Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by ikegami (Patriarch)
on Nov 09, 2006 at 23:33 UTC ( [id://583256]=note: print w/replies, xml ) Need Help??


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

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.

Replies are listed 'Best First'.
Free Nodelet Hack: Focus to your CB talkbox automatically
by jdporter (Paladin) on Nov 10, 2006 at 19:25 UTC

    Here's another cool thing to add to your onLoad function:

    document.getElementById('talkbox').focus();
Re^10: Free Nodelet Hack: Nodelets on the left
by Argel (Prior) on Nov 10, 2006 at 02:01 UTC
    Nice!! I wish I could ++ both of you several times!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 15:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found