homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

when Opera is too helpful

 5:58 pm on Jul 29, 2011 (gmt 0)

I've got one of those cute scrolling areas that's made by putting a wide div inside of a regular-sized div and adding a couple lines of javascript. (Exact code isn't relevant to the question; in my case it holds a series of thumbnails with popup full-size pictures.) Yesterday I got an awful scare when it looked as if the arrangement didn't work in Opera: no matter what I said or constrained or exclamation-marked, it flatly refused to keep the inner div on a single line. And, of course, if the overflow drops down to a second line, the user can't see it at all because the whole point is that you don't auto-generate a scrollbar.

Turns out the culprit is a preference setting, "Fit to width" under Zoom Pages. I never use Opera except for code-testing, so I have to assume this setting is on by default. (It explains some weird behavior in other situations, and I can see where it would be useful on some sites, notably the ones that are always hot-linking to my images.) Looks like it takes any horizontal dimension that's wider than the current window and simply ignores it. There's no way you could expect the browser to figure out that this particular value is supposed to be greater than the available width.

So how do other people deal with this? Is there a way to look up the preference setting? Either to override it for this site alone (following the spirit rather than the letter of the pref, so I'm really not going against the user's wishes) or to throw out a one-time message telling users how to make the scroll area behave as intended.

I don't speak php so the answer, if any, would have to come from javascript. If the preference setting can't be read directly, I might be able to figure out something analogous to the routine that checks if you've got a particular font installed, like seeing if a 4000-px div comes out wider than a 3000-px div. But that's definitely in Option C territory.



 6:27 pm on Jul 29, 2011 (gmt 0)

I don't think "fit to width" is default on Opera ..at least not on Linux ..I had to tick a box to use it..

re php browser sniffing ( especially Opera )..go [dauidusdesign.com ] here, he explains it all rather nicely IMO :-)


 7:13 pm on Jul 29, 2011 (gmt 0)

As Leosghost suggests, "Fit to width" is NOT ON by default in Windows either. However, users can set this to be on all the time in Preferences, but I think that would be a bit risky as it breaks quite a few sites IMO.


 8:08 pm on Jul 29, 2011 (gmt 0)

Oh, that's reassuring. Wonder how I came to change it? (Answer: probably by misunderstanding what it would do. I've often had to un-set preferences in Graphic Converter after realizing Yeowch! That is definitely not what I wanted!)

I may try Option C anyway just for the fun of seeing if it works (font-testing worked a treat* after I got rid of all the error-handling extranea ;))

* Except on some versions of IceWeasel and Firefox for Linux, due to a non-standard fallback system. But there's a workaround.

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