Forum Moderators: open

Message Too Old, No Replies

Allowing for scrollbars

Blanck popup environment

         

henry0

1:12 pm on May 20, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tried to allow for scrollbars in a few spots in both top and script.
traded 'yes' for '1'.
but it does not work.
How will you write it to allow for scrollbars?
(FYI the rest works fine.)
Thanks
Top of page:
<script type="text/javascript">
function showPopup(url) {
newwindow=window.open(url,'pop','height=600,width=800,top=50,left=50,resizable ');
if (window.focus) {newwindow.focus()}
}
</script>

In script
$url="<a href='$news_url' name='pop' target='_BLANCK' onClick='showPopup(this.href);return(false);' </a>>";

rocknbil

6:51 pm on May 20, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Henry, miss our chats.

Yes, 1, and just mentioning the attribute are the same thing. 0, no, and leaving the attribute out are all synonymous.

Additionally don't hard code the window ID. Make it unique. Reason?

- Someone opens a pop up.
- clicks back in main window.
- click another link and opens in the window named "pop" which is now behind the main window
- user closes browser thinking "this site is broken"

Also returning false from this function will allow you to dispense with the extra inline "return false" - see accompanying html.


function showPopup(url) {
var day = new Date();
var id = day.getTime();

newwindow=window.open(url,id,'height=600,width=800,top=50,left=50,resizable,scrollbars');
if (window.focus) {newwindow.focus()}
return false;
}
</script>


$url="<a href=\"$news_url\" name=\"pop\" target=\"_blank\" onClick=\"return showPopup(this.href)\">$linktitle</a>";

Note that it will only show scrollbars if the content is large enough to push the window size larger than 600 X 800.

henry0

7:41 pm on May 20, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Bill, thanks
as always precise answer!
Email me about what you're up to
I'll let you know my new "toy"
Henry

henry0

8:01 pm on May 20, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OOPS; sorry but still does not work
I PMed you the URL
thanks

henry0

8:19 pm on May 20, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Double sorry!
Found the reason, another script was interfering,
now it's all good
thanks