Sign in to follow this  
Supaflyfrank

[web] New WebPage Javascript problems

Recommended Posts

Supaflyfrank    152
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.

Share this post


Link to post
Share on other sites
Daedalus AI    100
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.

Share this post


Link to post
Share on other sites
Daedalus AI    100

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.

Share this post


Link to post
Share on other sites
T1Oracle    100
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this