/    Sign up×
Community /Pin to ProfileBookmark

Setting Line Lengths With JS! [Help Needed]

Alright, basically the problem I’m having is clearly shown here: [URL=”http://www.kambani.com”]Kambani[/URL].

[CODE]
.vLine
{
position:absolute;
top: 135px;
left: 92px;
width: 2px;
height: 4500px;
background-color: rgb(255, 204, 51);
font-size: 1px;
}
[/CODE]

The vertical line has been set to a defined height of 4500px (cascade stylesheet page known as styles.css) in order to ensure it runs down every page, the obvious problem is that it’s way too long on certain pages (the index page being a prime example) – therefore some viewers will be scrolling down to the end of the page in order to view it.

[CODE]function writeHeader()
{
document.write( “<img src=”images/HeaderImage.jpg” width=”765″ height=”115″ border=”0″>” +
“<div class=”vLine”></div>” +
“<div class=”hLine”></div>” +
“<div class=”kLogo”><img src=”images/Kambani.jpg” width=”258″ height=”90″ border=”0″></div>” +

“<div class=”navBar”><nobr>”);

writeNavBarLink(“index.htm”, “home”);
writeNavBarLink(“aboutus1.htm”, “about”);
writeNavBarLink(“gallery1.htm”, “gallery”);
writeNavBarLink(“events.htm”, “events”);
writeNavBarLink(“artist1.htm”, “artists”);
writeNavBarLink(“contact.htm”, “contact”);

document.write( “</nobr></div>”);
}[/CODE]

^ Shows how the line is implemented – it’s known as vLine as shown earlier. This is in a javascript file, this certain section is showing how the header works (the navigation).

Personally, my JS script knowledge is extremely limited to the work I’ve been doing on that website as the webmaster – I’m mostly good at using ASP forms. The little knowledge I do have of JavaScript allows me to realise it’s the only way I’ll be able to correct this issue.

I wouldn’t mind using an entire javascript to define the line’s properties of it instead of it being defined in a CSS file, I’d simply add it to one of the many javascript files that are loaded.

By looking at it, it’d need to define the height of the page before the line is brought into place, so I’m guessing the use of a function instead of an entire script is possible.

Please also take into effect that there is a lot more happening on the website, therefore I’d be extremely happy if the code is uneffective on any other dynamic scripts taking place.

Also, please keep in mind that I’m only 15 years old – I may not understand what I’m given straight away although I am quite good at interpreting scripts given to me. If I don’t understand what the script does after looking at it myself, please be patient to any mistakes I may make.

Thank you for your time & effort.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 25.2007 — Why use JavaScript when CSS would be much easier and make your site accessible?
Copy linkTweet thisAlerts:
@JPnycAug 25.2007 — Set the CSS height value to 100%
×

Success!

Help @Traiken 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.18,
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,
)...