IT Community - Software Programming, Web Development and Technical Support

Can I get javascript to determine a browsers font setting and alter

This is a discussion on Can I get javascript to determine a browsers font setting and alter within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; How can I get javascript to determine a browsers font setting and alter it to whatever I choose so that ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-21-2007, 10:28 PM
srikumar_l srikumar_l is offline
D-Web Sr.Programmer
 
Join Date: Aug 2007
Posts: 196
srikumar_l is on a distinguished road
Default Can I get javascript to determine a browsers font setting and alter

How can I get javascript to determine a browsers font setting and alter it to whatever I choose so that my site is cross-browser/font size compatible?

Different browsers use their setups differently and mostly what you are
trying to do may cause the browser, therefore the user a problem. I am
not sure that too many people will like the idea of a web page changing
their browser's settings.

I suspect your best bet would be to check their screen resolutions.
As far as I am aware, all browsers support the screen object and this
means the property values of width and height are available. This
implies you can change those values or redirect the browser to a page
you have prepared for a specific resolution.

<script language="JavaScript"><!--
function screenres(){
if (window.screen.width=='600') {
location.href = '600.html'; }
else {
if (window.screen.width=='800')
location.href = '800.html';
else if (window.screen.width=='1024')
location.href = '1024.html';
else if (window.screen.width>'1024')
location.href = 'other.html';
}
}
//--></script>

</head>
<body onload="screenRes()">
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sort record by alter statement prasath Database Support 2 03-31-2008 03:55 AM
How to change button's font? S.Vinothkumar HTML, CSS and Javascript Coding Techniques 3 10-07-2007 10:11 PM
What browsers support JavaScript, and where can I find documentation? Pvinothkumar HTML, CSS and Javascript Coding Techniques 1 09-17-2007 11:15 PM
Set Position of Browsers Scrollbar using Javascript ? kingmaker HTML, CSS and Javascript Coding Techniques 1 07-19-2007 12:33 AM
Whats your text? Font , Size etc killerkev06 The Lounge 4 04-06-2007 10:16 AM


All times are GMT -7. The time now is 10:17 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0