Thread: Resize Text
View Single Post
Old 07-26-2007, 07:03 AM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote