Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2004, 12:25 PM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default opening a window with scrollbars

Hi, friends:

I am trying to open a new window with the window.open() method.
I have the following problem using Internet Explorer:

If I set 'scrollbars=no' I get, as you may expect, a pop-up window with no scrolling facilities.
If I set 'scrollbars=yes' I do get the scrollbar always, even when it is not necessary.
Is there any way to get the scroll bar only if the document loaded needs scrolling?
(This only happens with IE. Netscape and Mozilla browsers only shows the scrollbars if they are necessary)

Thanks in advance

Tomàs Jiménez
OranginaLab
__________________
Tomàs Jiménez
OranginaLab
 
Old February 25th, 2004, 12:34 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Never had much luck with this. Is setting scroll=auto in the actual page being loaded an option?

--

Joe
 
Old February 25th, 2004, 12:53 PM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, Joe:

I'm afraid it doesn't work.
Setting 'scrollbars=auto' has the same effect that setting it to 'no'.
No scrollbars at all.

Thank you, anyway.

Tomàs Jiménez
OranginaLab
 
Old February 25th, 2004, 12:58 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

That's not what I suggested. I meant changing the scroll attribute of the page you are loading.

--

Joe
 
Old February 25th, 2004, 01:34 PM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Excuse my ignorance, Joe.

I'm afraid I don't know which attribute you are referring to.
Does it exist a window.scroll property? (I knew about a window.scroll() method but not such an attribute)
Or it belongs to the document object?

How do I change the scroll attribute?

Thank you for your patience.

Tomàs Jiménez
OranginaLab
 
Old February 25th, 2004, 03:36 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

When I use this line:

var newWin = window.open("newpage.php","winName","scrolling=aut o");

The new page has scrollbars only if the content exceeds the window size.

I am using IE6. I don't know why your new page has scrollbars...?

----------
---Snib---
----------
 
Old February 26th, 2004, 05:36 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Tomàs

This is what I meant:
http://msdn.microsoft.com/library/de...ies/scroll.asp

Snib

Is anything set in the page you are showing?

--

Joe
 
Old February 26th, 2004, 06:35 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That was exactly what I needed!!
My pop up windows will never show scrollbars when not necessary again.

Thank you very much, Joe.

(Snib: I've tried your suggestion but setting "scrolling=auto" made scrollbars disappear completely)

Tomàs Jiménez
OranginaLab





Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a New Window GailCG ASP.NET 2.0 Basics 14 April 1st, 2008 11:32 AM
opening a new window rgpassey Javascript How-To 2 September 14th, 2005 11:38 AM
Opening New Window p_nut33 Classic ASP Basics 1 August 6th, 2004 08:11 PM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM
Opening New Window james_sellwood ASP.NET 1.0 and 1.1 Basics 5 June 12th, 2003 11:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.