Welcome to WebmasterWorld Guest from 54.158.65.139

Forum Moderators: open

Onload remove scrollbars and all cept title

IF they are showing

   
10:40 pm on Apr 13, 2003 (gmt 0)

10+ Year Member



Hi, is there anyway to use the onload function to remove scrollbars address bar status bar, and all the bars sidebars etc cept title IF they are showing?

For my php gallery script,
Thanks

10:51 pm on Apr 13, 2003 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You can open a new window in that state (as you probably know) but AFAIK you can't mess with those elements on a window that was already open with another document before your document loads.

And I certainly hope that's the answer - I don't want anyone hacking with the browser layout that I chose for my main window.

10:56 pm on Apr 13, 2003 (gmt 0)

10+ Year Member



Nah, its for an image view thing, auto resize script I wrote for php instead of using the old predefined javascript method,

BUT

Is there a way to check to see if the scrollbars and all that are viewable and if they are to refresh the current page with them not viewable

11:31 pm on Apr 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I agree with Ted, it is not possible. Cludges are possible, such as:

1) changing your security privilages first, then changing the attributes. Netscape example below. Not really cross-browser, and results in an ugly dialog box asking the visitor to confirm that you are requesting more privilages (and most visitors with half a brain would say no):

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
window.menubar.visible=!window.menubar.visible;

2) Have the new window pop up another window, then close itself.

I must be missing something... I note that it is a php app, but still ... Why can't you can't put the code in the page which calls the new window, instead of from the onload() of the new window?

Shawn

11:58 pm on Apr 13, 2003 (gmt 0)

10+ Year Member



Look

photoshow.php is the script where the pic gets shown. There's another script media.php when you click a picture it opens that photoshow.php BUT

if you go directly to photoshow.php then well the toolbars etc are visible and it messes up the script to resize the window for the image

see what im saying?

[edited by: tedster at 2:26 am (utc) on April 14, 2003]

12:42 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So, if I understand it correctly, you have a page, media.php, which has a link to call up photoshow.php.

Yes?

What you need to do is edit media.php, so that it calls photoshow.php in a pop-up without status bar, menu bar, etc.

Shawn

12:48 am on Apr 14, 2003 (gmt 0)

10+ Year Member



Thanks but pls read the post.

"
here's another script media.php when you click a picture it opens that photoshow.php BUT

if you go directly to photoshow.php then well the toolbars etc are visible and it messes up the script to resize the window for the image

see what im saying?
"

Theres a link already for that

BUT if somone goes, hmm

I could check for the referer BUT some browsers dont send a referer :-/

12:54 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can get rid of the scrollbars by putting scroll=no in the body tag:
<body scroll=no>

I think the other bits of windowing are non-removable.

1:41 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Acecool

You don't need to check the referer; you could check whether the menu bar, etc are visible by looking at the window.menubar.visible attribute per my previous post; you just can't change it. You'd have to use one of the cludges I suggested. Are visitors likely to go directly to the pop-ups rather than through another of your pages?

Sorry I did not understand your post #5. I think the lack of full sentences/punctuation, etc fooled me. I guess I just read it too fast, sorry.

Shawn

[Removed sentence which is not relevant as it was responding to a post which has since been removed by the moderator]

[edited by: ShawnR at 2:43 am (utc) on April 14, 2003]

1:48 am on Apr 14, 2003 (gmt 0)

10+ Year Member



scroll=no

Thats 1 step closer :-)

Thanks, there must be a way to disable the status bar, toolbar address bar and the other bar for one window :-/

EDIT:

K I guess I forgot to actuatly use sentences heh :-/
Sorry for not making it readable.

I wanted it so people can link to the image directly and it will display without toolbars etc without having them to use the onclick window open...

So they can click on http://www.example.com/photoshow.php?pic=blah.jpg
and it will show up, remove the status and all that so the picture fits in perfectly.

Maybe ill recode it, I only have to change 1 variable so no window on open, then status and all that is visible and might not look so well on larger images, so thats why I wanted to do it this way :-)

[edited by: tedster at 2:25 am (utc) on April 14, 2003]
[edit reason] use generic domain name [/edit]

gph

5:39 am on Apr 14, 2003 (gmt 0)

10+ Year Member



I've never worked with popups but I know this works with modal windows

if (typeof dialogArguments == 'undefined') {
alert('no parent')
}

Just guessing but you might be able to test if the parent opened the popup like this


if (typeof opener == 'undefined') {
alert('no parent')
}
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month