make javascript repeat for each row in a view

Posted by Kathy Chavez on Stack Overflow See other posts from Stack Overflow or by Kathy Chavez
Published on 2011-12-01T09:36:20Z Indexed on 2011/12/01 9:50 UTC
Read the original article Hit count: 247

Filed under:
|
|

I have created a view in Drupal. I"m using javascript to modify css in each row. The script runs on the first row, but does not make the changes on the rest of rows from the view.

This is the script:

<script language="javascript" type="text/javascript">

window.onload = floatbr;

function floatbr() {

var f = document.getElementById('firstright') // Get div element
var s = document.getElementById('secondright') // Get div element
var w = document.getElementById('catwrapper') // Get div element
var sh = s.offsetHeight // secondright div height
var wh = w.offsetHeight // catwrapper div height
f.style.height = wh - sh + 'px'; }

</script> 

I'm using it from this page: http://agsone.100webcustomers.com/floatbottom.php

having the script in the page once does not do the trick. having the script in the view footer and repeating the script does not work.

THanks!

link to fiddle with html, css & js: http://jsfiddle.net/Vvjku/

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about drupal