View Full Version : javascript access to font selection, colors, and language selection
Both IE and NS allow the user to specify the font or font size with which a web page will be rendered, as well as things like the color of links and the users locale. This is not available to the user if one opens a windows with no menu or toolbar.
Is there a way to set this from within javascript, so that I can prompt the user? Or must I programatically hack up a style object and apply it somehow to the entire page?
brothercake
03-26-2003, 12:34 AM
You can programatically change font size, and in fact any CSS, from javascript. this thread (http://codingforums.com/showthread.php?s=&threadid=14259) has the basic technique.
But ... forgive me for asking ... why not just show the menubar?
menubar="yes"
?
We're running inside of another applications framework and it starts with a plain vanila window with no decorations.
They don't want the users to use the back/forward buttons or press the 'stop' button, because it would interfere with their processing. We're not allowed to spawn our own window because they think the users would be too stupid (oops, lack the computer skills) to find our window if it got accidentally hidden. The application is for people used to working with phones, not computers. So this is basically a customer/application requirement.
Thanx for the information. I will try it out.
brothercake
03-26-2003, 04:24 PM
Originally posted by wac
They don't want the users to use the back/forward buttons or press the 'stop' button, because it would interfere with their processing
Well, are you aware that:
1 - you can't stop people going back and forwards - I can right click and go "Back", or use a mouse gesture in Opera, among other ways.
2 - I wasn't suggesting you show all decorations anyway - the back/forward buttons etc are the "toolbars" property, but file, view etc. are the "menubar" property - I suggested you show the latter, for the sake of the font sizing you want.
IMHO if their process can't handle a user who clicks the back button, then their process is badly or lazily written.
Sorry .. I know these comments are irrelevant to you; it's a personal bugbear ;) That DOM 2 CSS will give you the control you need, no probs.
Thanx for the reply brothercake. Acually, the product only supports connection via IE6+ and (soon) NS6+. The current product suppresses the popup menu in IE by somehow assigning that function to an empty javascript function.
So the users have no tool bar, menu bar, or context menu popup.
This is what we have to live with. I'll use your suggestion about
creating a style sheet class that all other styles (that we care about modifying font and color) inherit from.
Thanx
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.