Reply
Easiest script ever needed
Old 11-02-2009, 04:03 AM Easiest script ever needed
Junior Talker

Posts: 4
Trades: 0
I recently added an awesome javascript to my site that ensures all of my divs are exactly the same height.

The problem is that one of the divs needs to be offset by 175px.
This div is extending in unison with the other columns, however, it is always exactly 175px short.

Can I run a second javascript telling my navigation div to extend yet another 175px after the first script is run so that they are all even?

I am fairly new to web design. I am assuming I might have to add a unique class to my navigation div, and then create a script saying "dude, add another 175px height ok thanks"

Any help would be greatly appreciated!
fritzguye is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 11-02-2009, 05:47 AM Re: Easiest script ever needed
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Any sources would be greatly appreciated too. Script and HTML.

Why make it a second script, when you could have the existing one doing it for you.
But without seeing the script itself, and what it does, it's going to be rather hard.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 11-03-2009, 10:04 AM Re: Easiest script ever needed
Junior Talker

Posts: 4
Trades: 0
The site is here below. Only the homepage is currently correct:

http://teknekwebservices.com/


The original script I found on the internet. It goes like this:

/*
Derived from a script by Alejandro Gervasio.
Modified to work in FireFox by Stefan Mischook for Killersites.com

How it works: just apply the CSS class of 'column' to your pages' main columns.
*/
matchColumns=function(){

var divs,contDivs,maxHeight,divHeight,d;

// get all <div> elements in the document

divs=document.getElementsByTagName('div');

contDivs=[];

// initialize maximum height value

maxHeight=0;

// iterate over all <div> elements in the document

for(var i=0;i<divs.length;i++){

// make collection with <div> elements with class attribute 'container'

if(/\bcolumn\b/.test(divs[i].className)){

d=divs[i];

contDivs[contDivs.length]=d;

// determine height for <div> element

if(d.offsetHeight){

divHeight=d.offsetHeight;

}

else if(d.style.pixelHeight){

divHeight=d.style.pixelHeight;

}

// calculate maximum height

maxHeight=Math.max(maxHeight,divHeight);

}

}

// assign maximum height value to all of container <div> elements

for(var i=0;i<contDivs.length;i++){

contDivs[i].style.height=maxHeight + "px";

}

}

// Runs the script when page loads

window.onload=function(){

if(document.getElementsByTagName){

matchColumns();

}

}
fritzguye is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 08:55 PM Re: Easiest script ever needed
Junior Talker

Posts: 4
Trades: 0
Anyone? I'll pretend to buy you a beer if you can figure this out!!!!
fritzguye is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 09:25 PM Re: Easiest script ever needed
treyk4's Avatar
Skilled Talker

Posts: 80
Name: Trey
Trades: 0
Could you not just use a pure-CSS solution?
You don't want to use javascript for page layout.

Sorry, I won't help you with your script request. But I will point you in a direction for solving this with CSS.

Liquid 3-column CSS layout: http://matthewjamestaylor.com/blog/perfect-3-column.htm
Fixed 3-column CSS layout: http://www.neuroticweb.com/recursos/...olor_iz=CC6633

Also, this: http://www.google.com/search?q=css+3+column+layout
__________________
Decatur-Austin Robotics Coalition (DARC) - http://darcrobotics.org
treyk4 is offline
Reply With Quote
View Public Profile
 
Old 11-08-2009, 10:14 AM Re: Easiest script ever needed
Junior Talker

Posts: 4
Trades: 0
thanks. I don't know what I was thinking...
fritzguye is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Easiest script ever needed
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11848 seconds with 13 queries