/    Sign up×
Community /Pin to ProfileBookmark

whole webpage shifting in firefox

best way to explain it is to show it i guess [URL=”http://lawlocaust.net/gamerverse/”]http://lawlocaust.net/gamerverse/[/URL] if u hover over the banner area at the top u can use the arrow keys to navigate the site and when u press an arrow key in firefox the page shifts

i am pretty sure the problem is occuring from this

[CODE]
<div class=”page” id=”page”>
<table cellspacing=”0px”; cellpadding=”0px” id=”main”>
<tr>
<td><div><?php include(‘home.php’); ?></div></td><td><div><?php include(‘users.php’); ?></div></td><td><div><?php include(‘games.php’); ?></div></td><td><div><?php include(‘new.php’); ?></div></td><td><div><?php include(‘forum.php’); ?></div></td><td><div><?php include(‘guilds.php’); ?></div></td><td><div><?php include(‘store.php’); ?></div></td>
</tr>
</table>
</div>
[/CODE]

and this

[CODE]
//winH is the height of the window
//winW is the width of the window
var td = document.getElementsByTagName(‘td’);
for(i = 0; i < td.length; i++)
{
td[i].width = winW+”px”; //sets the width of each table cell to the window width
td[i].style.height = (winH-h)+”px”;
td[i].firstChild.style.height = ((winH-h)-58)+”px”;
td[i].firstChild.style.width = ((winW – (td[i].firstChild.offsetLeft*2))-8)+”px”;
}

[/CODE]

so basically my div with the id page is like 7 screens wide
how do i stop this
also it works fine in both google chrome and IE8

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorNov 06.2009 — <i>
</i>td[i].firstChild.offsetLeft

That will be always 0. [B]offsetLeft[/B] returns the left position of an element [I]relative to its parent[/I].

You have also an error in IE. It is hard to say which, as IE has a poor javascript debugger.
Copy linkTweet thisAlerts:
@godofrealityauthorNov 07.2009 — double checked that and it is not the cause of the problem anyone else have any ideas as to the cause?
×

Success!

Help @godofreality spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...