-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
How can I turn off slide down animate effect for Combobox and Bandbox? It can be simply seem at Live Demo page, combobox and bandbox sections.
I like to have just usual behavior like in ZK3, which has no kind of visual effect.
Just want behavior like simply click then, dropdown/popup in fast/generic manner.
Many thanks.
I've done the following to disable the animation globally: put the following into your zk.xml file :
<device-config> <device-type>ajax</device-type> <embed><![CDATA[ <script type="text/javascript"> jq(function() { setTimeout(function() { if (window.zul && window.zul.inp && window.zul.inp.Combobox) { zul.inp.Combobox.prototype.slideDown_ = function(pp) { jq(pp).css("visibility", "visible").css("display", "block"); }; } }, 100); }); </script> ]]></embed> </device-config>
This ensures that the slideDown_ is overridden on every page. Notice that it's setup to run with a 100ms delay from jQuery's ready handler - this is necessary, as for some reason on Webkit browsers (Chrome & Safari) it seems that when jQuery's ready handler fires, the javascript file containing the Combobox widget is not yet fully loaded.
Unfortunately, this code causes some rendering anomalies for the bandbox. Shortening the animation duration works much better for my application, but having to modify the prototype in this way seems like overkill. While SimonPai's enhancement request was denied, I have submitted another more specific request to allow changing this duration value in a more straightforward manner (and consistent with how other settings can be modified).
Hi, SimonPai
I use Zk 5.0.4 and your code works fine remove bandbox animation.. thank you :)
Hi all,
With the latest build (09/02) of 5.0.4, now we can reduce the above code snipplet down to
<zk> <script defer="true"><![CDATA[ zul.inp.Combobox.prototype.slideDown_ = function(pp) { pp.style.visibility = "true"; pp.style.display = "block"; }; zul.inp.Bandbox.prototype.slideDown_ = zul.inp.Combobox.prototype.slideDown_; ]]></script> <combobox> <comboitem>Comboitem 1</comboitem> <comboitem>Comboitem 2</comboitem> <comboitem>Comboitem 3</comboitem> </combobox> <bandbox> <bandpopup> <vbox> <label>Label 1</label> <label>Label 2</label> <label>Label 3</label> </vbox> </bandpopup> </bandbox> </zk>
To change slide up effect, override slideUp_ function instead.
Regards,
Simon
This Problem affects me too.
At the moment I just ignore it but by the time our new release rolls out this will become a problem for me.
I would prefer to globally disable animation instead of editing js-files for every release.
Regards,
Martin
There is also another reason to turnoff fading-effects:
All this effects are slow with X11/windows terminal/citrix-clients. Instead of 1 screenupdate, there are many updates.
/Robert
Asked: 2010-06-01 05:09:49 +0800
Seen: 2,416 times
Last updated: Aug 06 '11