jquery - How can i FADE IN and OUT a list that appears (using the .bind command? -
This is the code I am using to display a list on the title of the list on mousenter
The thing is that it appears and disappears very suddenly, what can I do to make it smoother?
Many thanks for your time!
& lt; Script type = "text / javascript" & gt; Var timeout = 0; Win cell = 0; Var ddmenuitem = 0; Function jsddm_open () {jsddm_canceltimer (); Jsddm_close (); Ddmenuitem = $ (this) .find ('ul'). CSS ('visibility', 'view');} function jsddm_close () {if (ddmenuitem) ddmenuitem.css ('visibility', 'hidden')}} function Jsddm_timer () {closetimer = window.setTimeout (jsddm_close, timeout) ;} Function jsddm_canceltimer () {if (colitimer) {window.clearTimeout (collater); Bind ('MouseSent', JSDMOpen) $ ('# JSDM & gt; Li'). Bind ('Mouseleave', jsddm_timer)}); Document.onclick = jsddm_close; & Lt; / Script & gt;
Your two rows that set the visibility:
< Code> Ddmenuitem = $ (this) .find ('ul'). CSS ('visibility', 'visible'); Ddmenuitem.css ('Visibility', 'Hidden');
Try instead:
ddmenuitem = $ (this) .find ('ul'). Show ('slow'); Ddmenuitem.hide ('slow');
On one side:
Your previous few lines may just be a bit lower:
$ (document) .ready (Function () {$ ('# jsddm & gt; li'). Mouseover (jsddm_open) $ ('# jsddm & gt; li') .mouseout (jsddm_timer) $ (document). Click (jsddm_close);}) ;
or even:
$ (document) .ready (function () {$ ('# jsddm & gt; li') Hover (jsddm_open, Jsddm_timer) $ (document). Click (jsddm_close);});
Comments
Post a Comment