0

i want to call the functions movein(this) & moveout(this) directly with out using onmouseover or onmouseout by the way (this) is [object htmlDivElement]

  var tb = '<div id="' + o.id + '" onmouseover="movein(this);" onmouseout="moveout(this);"><div><table>\n';
jjj
  • 605
  • 1
  • 9
  • 26

2 Answers2

2

Tried movein(document.getElementById(o.id)) & moveout(document.getElementById(o.id)) ?

K Prime
  • 5,809
  • 1
  • 25
  • 19
  • but there is a table ... can you rewrite the hole code? thanks – jjj Dec 09 '09 at 07:58
  • All you really need to take care of is passing the right id (of the element you want) to _document.getElementById_. Whether it's a DIV or TABLE doesn't really matter, unless _movein_ / _moveout_ expects a certain kind – K Prime Dec 09 '09 at 09:50
1

Using event delegation may be an option for you, see my answer to this question. Using event delegation, you define a mouseover/-out handler on the table and let the handler decide if and what action has to be taken.

Community
  • 1
  • 1
KooiInc
  • 119,216
  • 31
  • 141
  • 177