[H-GEN] need some html/javascript pointers (setting window attributes)

Tony Nugent tony at linuxworks.com.au
Fri Jan 6 03:02:04 EST 2006


Thanks for the reply...

> -----Original Message-----
> Sent: Friday, January 06, 2006 4:17 PM
> Subject: Re: [H-GEN] need some html/javascript pointers (settingwindow
> attributes)

[snip]

> > If I use a js window.open(.) command in a test page, I can get want I
> > want with creating the new window (bare with nothing but the content and
> > no bars within it at all), but opening yet another browser window in
> > that manner is an awkward and ugly way to do it in this particular
> > situation - I don't want to clutter the place with browser windows, and
> > I don't really want to write screeds of complicated code just to achieve
> > what I want.
> >
> 
> Yep, this is the way everyone does it as far as I know.  You have to
> create the bare window using Javascript in the parent.  You can't remove
> the menu bars etc. after opening the window.

Ahh, ok.  So it can't be done like that.  Noted. (damn!)
 
> Didn't you say above that you're opening new windows anyway?  You can
> use the same window name in the Javascript window.open() function
> multiple times to get the results to open in a single new window, if you
> want, just the same as you do with a target="" attribute.

Yes, this looks like the way that I'll have to resort to doing (my raw test code
just about does that already).  I'll try initially opening the (named) target
window from the form in the parent window with onSubmit() - if that window
doesn't already exist (perhaps testing for that isn't necessary, I'll have to
experiment - is it ok to re-open an open window?)  But at the same time, it
means a bit of a re-design with how I've been doing it so far.  Oh well.  But
once it's done, it's done.  It's all modular in functions etc, so hopefully it
shouldn't be too hard to achieve what I want (fingers crossed).

> > Surely it should be possible to do some simple javascript (or other)
> > magic get the target window to turn off these various menu/info bars
> > */when the page loads!/*  ??  You'd think so, but I just can't seem to
> > get it to happen like that.
> 
> There's no way that I know of.

Ok, so I'll have to live with it.  Oh well, there's more than one way to skin a
cat (although I don't eat meat :-)
 
> A friend of mine has an image gallery that opens a window and resizes it
> to the image size after the image loads, maybe that's what you're
> looking for?  His site is http://www.gdaytiger.com
> 
> View the photo galleries, click to enlarge a pic and you'll see.

Yes, that's very close to the sort of thing I want to achieve, it's very cool
(especially working with picture galleries and thumbnail etc).  But what I'm
working with is a bit more complicated than that.  I'll just have to work around
the limitations.  So now my window.open() testing code is about to become
incorporated into what I'm doing.

> The only alternative I can think of is to use some DHTML.  An DIV tag
> with absolute CSS positioning can be made to show anywhere on the page
> you want, and even dragged about by the user with some wacky javascript,
> if you want that.  When the user clicks an image you could make the DIV
> visible, set an IMG tag's .src attribute inside the DIV tag and resize
> it all to the dimensions of the image.  Would be some work, but would
> look cool.

Oh, good suggestions, thanks.  In fact, it has given me some inspiration for
some new ideas to work with in other places.

But the real pain with all this is making sure that the code I end up with will
work in all browsers, and sometimes that can be a frustrating issue.  I've got
some dhtml drop-down/pop-up navigation menus already working nicely, so I'm
getting used to detecting, and using slightly different coding for, different
browsers (especially catering for the older ones - but they all have their
quirks, pita).  It makes things a lot more complicated than they really should
be, but at least I have managed to hack all the dhtml/js code to make it work as
expected, heh.  (And thanks to some excellent javascript-oriented
tuition/example sites around the 'net for the help with doing that).

I think the best part of it is the pleasure of finally seeing it happen once the
right spells have been cast!  It really is amazing what you can do with the
combination of server-side php, css, and client-side javascript.

> Good luck!

Thanks again.  Well, I've now got a bit of re-coding to do - it should keep me
busy over the weekend...

> Glenn
> glenn at kentwell.net

Cheers
Tony Nugent
Home: +61 7 5526 8020






More information about the General mailing list