|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
|||
|
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? |
|
|
||||
|
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.
__________________
Click the image if at any point you don't like my decision.10011100011000101111100011100000011000000100000011 10010011011110110001101101011011110100011000001110 0100111101000100001 Visit Nilpo.com and Ask the Windows Guru! Open me for some very useful links!
![]() |
|
|||
|
The script language="JavaScript" type="text/javascript" might help out alot dood
|
![]() |
| Viewing: Dev Hardware Forums > SOFTWARE > Programming > JavaScript - Resize Text |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|