homepage Welcome to WebmasterWorld Guest from 54.226.0.225
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Onload remove scrollbars and all cept title
IF they are showing
Acecool




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

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

 

tedster




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

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.

Acecool




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

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

ShawnR




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

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

Acecool




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

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]

ShawnR




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

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

Acecool




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

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 :-/

figment88




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

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.

ShawnR




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

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]

Acecool




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

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




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

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')
}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved