# ZK5 Combobox/Bandbox - slideDown animate effect

victorskl
43 3

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.

delete retag edit

## 16 Replies

39

Hi florimon , how to overridden the slideDown_ in every page ?

florimon
9

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.

martindk
19 1

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).

mikehellsing
42 1 1 1
http://kurohide.wordpress...

Hi, SimonPai

I use Zk 5.0.4 and your code works fine remove bandbox animation.. thank you :)

Bobzk
428 1 5

Hi SimonPaql,

Yes, works fine now. I should not have been so lazy and spent some more time on it - I'd have found it myself eventually.

Thanks.

SimonPai
1696 1

Hi Bobzk,

pp.style.visibility = "visible";


Thanks for pointing this out.

Regards,
Simon

Bobzk
428 1 5

The above code does not work in IE 7.0.5730.13

Error: Could not get the visibility property: invalid argument

SimonPai
1696 1

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

mw88
93 2
http://www.mw88.org

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

robertpic71
1275 1

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

[hide preview]