As a solution gets more complex (can we say Scope Creep?) then you find yourself needing to do more and more with the same stuff.
I created a screen full of thumbnails that have a click feature that opens a popup div on the page. The popup div code uses
Code:window.onresize = myresizedivcode;
.
This works like a charm and ensures the popup stays in the viewable area by expanding and contracting as the browser is resized.
Then we decide that we no longer want a scrollbar on the window that shows the thumbnails. This means we now place them in a div and allow the div to have a scrollbar. So, next step,
Code:window.onresize = resizethumbdiv;
. OUCH! This works great until we click on a thumbnail and the window.onresize command gets overwritten.
After the thumb is clicked the thumbnail div no longer resizes.
So, now we need multiple handlers for the onresize event.
To do this we use attachEvent
see MSDN.
Code:
attachEvent('onresize',myresizedivcode);
Xcellent - now we have multiple custom functions firing when the onresize event fires.