1

ZK5 Combobox/Bandbox - slideDown animate effect

asked 2010-06-01 05:09:49 +0800

victorskl gravatar image 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 flag offensive retag edit

16 Replies

Sort by ยป oldest newest

answered 2011-08-06 02:01:46 +0800

adisonz gravatar image adisonz
39

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

link publish delete flag offensive edit

answered 2011-03-22 11:06:29 +0800

florimon gravatar image 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.

link publish delete flag offensive edit

answered 2011-02-08 03:04:03 +0800

martindk gravatar image 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).

link publish delete flag offensive edit

answered 2010-10-26 04:26:21 +0800

mikehellsing gravatar image 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 :)

link publish delete flag offensive edit

answered 2010-10-01 02:53:09 +0800

Bobzk gravatar image Bobzk
444 1 8

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.

link publish delete flag offensive edit

answered 2010-09-30 20:57:38 +0800

SimonPai gravatar image SimonPai
1696 1

Hi Bobzk,

My bad, it's wrong CSS value. Instead please try to use

pp.style.visibility = "visible";

Thanks for pointing this out.

Regards,
Simon

link publish delete flag offensive edit

answered 2010-09-29 06:43:30 +0800

Bobzk gravatar image Bobzk
444 1 8

The above code does not work in IE 7.0.5730.13

Error: Could not get the visibility property: invalid argument

link publish delete flag offensive edit

answered 2010-09-02 21:02:58 +0800

SimonPai gravatar image 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

link publish delete flag offensive edit

answered 2010-09-01 05:10:39 +0800

mw88 gravatar image 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

link publish delete flag offensive edit

answered 2010-08-06 04:46:01 +0800

robertpic71 gravatar image 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

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-06-01 05:09:49 +0800

Seen: 2,416 times

Last updated: Aug 06 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More