I have a script on my site which expands and collapses div elements. This first part goes in the head: function ToggleVis(elem, tohide) { if (typeof(elem) != "object") { elem = document.getElementById(elem); } if (typeof(tohide) != "object") { tohide = document.getElementById(tohide); } if (tohide == null || tohide.style == null) { return false; } if (tohide.style.display != 'none') { tohide.style.display = 'none'; elem.innerHTML = 'Show store info +'; elem.value = 'Show store info +'; } else { tohide.style.display = ''; //(elem.innerHTML != null) ? elem.innerHTML = 'Hide store info -' : elem.value = 'Hide store info -'; elem.innerHTML = 'Hide store info -'; elem.value = 'Hide store info -'; } } Code (markup): And this other part goes in the body: <a href="#" onclick="ToggleVis(this, 'div_id'); return false;">Show store info +</a> <div id="div_id" style="display: none">Content to be expanded and collapsed.</div> Code (markup): When the anchor is clicked, the content in the div is expanded/collapsed. I also have another script in my site's body element which copies text to clipboard: <script type="text/JavaScript"> var clip = new ZeroClipboard.Client(); clip.setText('CODE1'); clip.glue('button'); clip.addEventListener('mouseOver', function(client) { document.getElementById("hoverpopup").style.visibility = "visible"; } ); clip.addEventListener( 'mouseOut', function(client) { document.getElementById("hoverpopup").style.visibility = "hidden"; } ); clip.addEventListener( 'complete', function(client, text) { document.getElementById("hoverpopup").style.visibility = "hidden"; window.open('http://www..com','','width=400,height=200'); } ); window.onresize = resize; function resize() { clip.reposition(); } </script> Code (markup): Is there a way of making the resize() function of the second script fire whenever a div is expanded or collapsed with the first script?