View Full Version : call event of another object
barbiturat
05-31-2005, 10:17 AM
It's possible, when focus jumps to one of links, automatically call javaScript, which is caused by event onfocus of another link?
i've tried this, but it's not works:
onfocus="document.links(5).onfocus()"
IKLOP
05-31-2005, 10:41 AM
use the focus() function to set the focus of an element. Also, it should be links[5] instead of links(5). Parenthasis mean it's a function:onfocus="document.links[5].focus()"
barbiturat
05-31-2005, 10:51 AM
i need to call set of functions, that assotiated with "onfocus" event of another link. Not just put focus on it.
IKLOP
05-31-2005, 11:00 AM
focus() will call create the onfocus event of the link it is applied to.
barbiturat
06-01-2005, 03:55 AM
But and i need, that focus must stay put, not "jumps" to another link.
IKLOP
06-01-2005, 05:24 AM
i see. After doing a little research, I found a function that should do it, handleEvent(), though I can't get it to work in firefox (maybe it doesn't support it) and I'm pretty sure it doesn't work in IE.
All I can recommend is putting whatever is in the onfocus for the first link into the onfocus for the second link.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.