Hi everyone.. i know Popups are a bad thing, but for my personal desktop i'm trying to create a popup that scrolls a page (news site etc.) down to a fixed position: //simple popup that works <a href="javascript:void(0);" onClick="window.open('http://site.com/news', 'popup', 'location=no, menubar=no, scrollbars=0, status=no, resizable=no, width=400, height=300'); ">Open Popup</a> Code (markup): //??? window.scrollTo(350, 0); window.setTimeout ( ??? ) Code (markup): Does anyone know how to apply the SetTimeout() to make the scroll actually work? Thanks for help!
you must place you code into a function, then use setTimeout method to execute setTimeout Method hope this is useful
something like this will work: <a href="javascript:openWindow();" >Open Popup</a> <script type="text/javascript"> var myPopup; function openWindow() { myPopup = window.open("mynews.html", 'popup', 'location=no, menubar=no, scrollbars=yes, status=no, resizable=no, width=400, height=300') setTimeout("myPopup.scrollTo(0, 350);", 2000); } </script> Code (markup): But... Most (if not all) browsers will only allow javascript to scroll the contents of a popup IF the page that is loaded is from the same host as the page that has created the popup. I'm not sure if there is a way around this, maybe loading a local file that has a frame containing the intented target, and then scrolling it from there... But it may not even allow that.