Skip to main content
gamedev.net
🔒 Locked

[web] New WebPage Javascript problems

Started by Supaflyfrank 3 replies 550+ views
Original Post
Supaflyfrank
Supaflyfrank
Hello this is my new webpage http://www.freewebs.com/supaflyfrank/Business.html i like the look of it alot better and I wanted to be able to have my page no scroll vertically like most webpages but instead only a certain area where the text is located scrolls. So the menu banner and everything stays the same and if they want to click on a new menu item they can just click it instead of scrolling up then clicking. But my problem is my code i use positions the div tag depending on the inner width of the browswer. But for some reason it works perfectly sometimes and other times it messes up by about 3 pixels. And I cant figure it out. And another problem that I am having is my javascript for IE. It complains that : Line : 53 document.all.layerName is null or not an object in my layerlib.js file. http://freewebs.com/supaflyfrank/layerlib.js the first problem i mention is on Firefox and the second problem is on IE. Any way anyone can assist me please thank you.
Daedalus AI
Daedalus AI
I'm having a quick guess here, but;

Quote:

window.onresize= Resizing;
window.onload = Resizing;


Shouldn't that be;

window.onresize = Resizing();
window.onload = Resizing();

I'm sorry if that's a dumb question, I just haven't seen that syntax before.

Daed.
Daedalus AI
Daedalus AI
function setY(layerName,y){	var theLayer = getElement(layerName);	if (layerobject)		theLayer.top = y	else if (opera)		theLayer.style.pixelTop = y;	else 		theLayer.style.top = y+"px";}


Your missing a ';' (Semicolon) on

theLayer.top = y (;)

Hope that helps,

Daed.
Supaflyfrank
Supaflyfrank
I dont know why I missed that but it seems that was the problem. Any idea on how to make it work on IE?
T1Oracle
T1Oracle
Quote:
Original post by Daedalus AI
I'm having a quick guess here, but;

Quote:

window.onresize= Resizing;
window.onload = Resizing;


Shouldn't that be;

window.onresize = Resizing();
window.onload = Resizing();

I'm sorry if that's a dumb question, I just haven't seen that syntax before.

Daed.

If he wants the function objects than the function the first statements are correct. If he wants the returned value from the functions then the second statement is correct. However, window.onresize needs a function object so the first statements are probably correct.
Programming since 1995.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.