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

Byron Ellacott bje at apnic.net
Mon Jan 9 23:07:16 EST 2006


On 06/01/2006, at 6:02 PM, Tony Nugent wrote:
>> 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.

> 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'd recommend w3schools.com for a lot of your JavaScript reference 
material.  Their CSS guides tend to be a bit IE oriented; I find the 
best CSS guide is actually the CSS2.1 reference and a site showing what 
IE doesn't implement.

My own recommendation for how to approach this problem is to avoid 
opening a new window altogether.  Trying to force the user's browser to 
operate in a particular way is always problematic, and often unwelcome. 
  To offer a preview pane, you can use an iframe element -- you can 
submit a form to the iframe to alter the image inside.  This approach 
degrades substantially better than trying to use JavaScript to open a 
window.  You don't need to worry about javascript, or whether the user 
has blocked popups.  The user doesn't have to worry about juggling 
focus between the window with the image and the window with the image's 
controls, and can have two browser windows open working on two separate 
images without confusion.  All HTML4.01 compliant browsers (ie, 
everything since IE4/NS4) can handle the iframe element just fine.

-- 
bje
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2335 bytes
Desc: not available
URL: <http://lists.humbug.org.au/pipermail/general/attachments/20060110/5ab4d21c/attachment.bin>


More information about the General mailing list