Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Dev Hardware ForumsSOFTWAREProgramming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old July 26th, 2007, 10:12 AM
Salchester Salchester is offline
Contributing User
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 293 Salchester User rank is Corporal (100 - 500 Reputation Level)Salchester User rank is Corporal (100 - 500 Reputation Level)Salchester User rank is Corporal (100 - 500 Reputation Level)Salchester User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 23 h 37 m 7 sec
Reputation Power: 5
JavaScript - Resize Text

Hi Folks,

How can the following script be adapted, in order for it to work in IE as well as FF?

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
var window_width = document.documentElement.clientWidth;
 
window.onresize = function(){
 
  var current_width = document.documentElement.clientWidth;
  if ( current_width > window_width )
  {
    document.documentElement.style.fontSize = 'large';
    window_width = current_width;
  }
  else
 {
    document.documentElement.style.fontSize = 'small';
    window_width = current_width;
  }
 
  alert('check: '+current_width);
 
}
</script>
</head>

<body>
hjkhjkhjkhjk
</body>
</html>
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?

Reply With Quote
  Trader Rating: 2 · #2  
Old July 28th, 2007, 01:04 AM
Nilpo's Avatar
Nilpo Nilpo is offline
Dev Hardware God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2004
Location: Salem, OH
Posts: 5,673 Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)Nilpo User rank is General 119th Grade (Above 100000 Reputation Level)  Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 Week 5 Days 20 h 1 m 5 sec
Reputation Power: 8888
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
It should work in Firefox. I don't see why it wouldn't.

And you really should declare your script type.

<script language="JavaScript" type="text/javascript">

I know that FF1 doesn't support the onresize event, but FF2 does.
__________________
Don't like me? Click it.

Scripting problems? Windows questions? Ask the Windows Guru!

Stay up to date with all of my latest content. Follow me on Twitter!

Help us help you! Post your exact error message with these easy tips!

Reply With Quote
  Trader Rating: 0 · #3  
Old October 30th, 2007, 09:03 PM
dash12345678 dash12345678 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 2 dash12345678 User rank is Sergeant Major (2000 - 5000 Reputation Level)dash12345678 User rank is Sergeant Major (2000 - 5000 Reputation Level)dash12345678 User rank is Sergeant Major (2000 - 5000 Reputation Level)dash12345678 User rank is Sergeant Major (2000 - 5000 Reputation Level)dash12345678 User rank is Sergeant Major (2000 - 5000 Reputation Level)dash12345678 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 27 m 15 sec
Reputation Power: 0
The script language="JavaScript" type="text/javascript" might help out alot dood
Comments on this post
mphill agrees!

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWAREProgramming > JavaScript - Resize Text


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
     
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT