[Seaside] javascript challenge

SainTiss saintiss at gmx.net
Wed Jul 9 07:53:11 UTC 2008

Hi all,

I've got the following scenario:

- There's a div with some text (D1)
- onMouseOver D1 I want to show another div (D2) which is hidden by default
- onMouseOut D1 I want to hide D2 after 2 secs, but ONLY if at that moment the 
mouse is not over D2.

If I would do this in plain javascript, I'd probably set a flag onMouseOver 
D2, and unset it onMouseOut D2. I'd use this flag in a function which is 
called onMouseOut D1, to check whether the mouse is over D2.

Now the question is how to do this in Seaside?

I found out that creating javascript code in an onMouseOut event handler can 
be done with

html div onMouseOut: (html javascript element id: 'D2'; hide)

Calling a function is easy:

<script> call: 'funname'

The timeout stuff is supported as well by the "timeout: delay" message.

However, I couldn't find out how to add an if-then-else, nor how to set a 
javascript variable which I can use as a flag.

Is it possible to do this the seaside way? Am I making this too difficult? Do 
I just need to use "html script" and use a plain javascript string?



A liberal is a person whose interests aren't at stake at the moment
  -- Willis Player

Hans Schippers
Research Assistant of the Research Foundation - Flanders (FWO - Vlaanderen)
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 37 88
Fax: +32 3 265 37 77

More information about the seaside mailing list