Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 13th, 2003, 04:53 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Positioning a form crashes IE 5.5

I have written a script which centers web page elements by changing the position of a style element according to the width of the page.

The script works fine until I put a form inside the style element on the page. Then it crashes IE5.5 and AOL 7 (kills dead!).

Is there something wrong with doing this. My HTML code and Script follows:

**Script**

function CentreWebDesign(DesignWidth)
{
var LeftStart=0;
var PageSize=0;
if (document.body.clientWidth != null)
{
PageSize=document.body.clientWidth;
}
else
{
if (window.innerWidth != null)
{
PageSize=document.innerWidth;
}
}
if (PageSize > DesignWidth)
{
LeftStart=Math.round((PageSize - DesignWidth)/2);
}
document.getElementById('container').style.left = LeftStart;
}

**End Script**

**HTML**

<html>
<head>
<title>title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript" src="c.js"></script>
<link href="content.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
#container{position: absolute; top: 15px; left: 0px}
-->
</style>
</head>
<body onLoad="CentreWebDesign(740); MM_preloadImages('images/faq-o.gif','images/contacts-o.gif','images/clients-o.gif','images/features-o.gif','images/services-o.gif','images/about-o.gif','images/home-o.gif')" onResize="CentreWebDesign(740)">
<div id="container">
<div class="heading">how to contact us</div>
<div class="content">
<form name="form1" method="post" action="thanks.php">
<table width="670" border="0" align="center" cellpadding="0" cellspacing="5" summary="Enquiry Form">
<tr>
<td width="158"><p class="formtext">Your Requirements</p></td>
<td width="487"><label for="textarea"></label> <textarea name="requirements" id="requirements"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="Submit" id="Submit" style="background-color: #DEEFAD; color: #336633; border: 1 solid #3FBE7B;">
<input type="hidden" name="stage" value="process"> <input type="reset" name="Reset" value=" Reset" id="label" style="background-color: #DEEFAD; color: #336633; border: 1 solid #3FBE7B;"></td>
</tr>
</table>
</form>
<p><br>
</p>
<img src="images/bottom.gif" width="720" height="78" alt=""></div>
</div>
</body>
</html>

**End HTML**

Any help would be great, this has bugged me for days!


Reply With Quote
  #2  
Old May 13th, 2003, 07:29 AM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Positioning a form crashes IE 5.5

No crashes here (win95 IE5.5), although I do get an error on the MM_preloadImages, but I assume you have this function in your original version.

I would do the centering function a little different though; this is what I would make of it:

function CentreWebDesign(DesignWidth) {

var PageSize = document.body.clientWidth || window.innerWidth;
if (PageSize > DesignWidth) {
var LeftStart = Math.round((PageSize - DesignWidth)/2);
document.getElementById('container').style.left = LeftStart+'px';
}

}

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Positioning a form crashes IE 5.5


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


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





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