[ 4 posts ]

Mona Patel

  • Username: mona_patel
  • Joined: Mon Nov 14, 2011 1:22 pm
  • Posts: 16
  • GitHub: Mona
  • Gists: Mona
  • IRC: Mona
  • Offline
  • Profile

Autocomplete yui3

Post Posted: Mon Nov 14, 2011 1:35 pm
+0-
In YUI 2, we can add animation in autocompleter itself using animation utility
Animation
If you include the YUI Animation utility on your web page, you can enable animation on the transitions of the AutoComplete container element using the following code:

// Container will expand and collapse vertically
myAutoComp.animVert = true;

// Container will expand and collapse horizontally
myAutoComp.animHoriz = true;

// Container animation will take 2 seconds to complete
myAutoComp.animSpeed = 2;


Can anyone let me know same thing how can we achieve using YUI 3 autocomplete?

Thanks in advance

Ryan Grove

YUI Developer

  • Username: rgrove
  • Joined: Tue Dec 09, 2008 9:55 pm
  • Posts: 275
  • Location: Portland, OR
  • Twitter: yaypie
  • GitHub: rgrove
  • Gists: rgrove
  • IRC: rgrove
  • YUI Developer
  • Offline
  • Profile

Re: Autocomplete yui3

Post Posted: Mon Nov 14, 2011 2:24 pm
+0-
Take a look at the WidgetAnim plugin, which allows you to define show/hide animations for any widget: http://yuilibrary.com/yui/docs/api/clas ... tAnim.html

Documentation is a bit sparse. Maybe someone with experience using WidgetAnim could chime in with an example?

Mona Patel

  • Username: mona_patel
  • Joined: Mon Nov 14, 2011 1:22 pm
  • Posts: 16
  • GitHub: Mona
  • Gists: Mona
  • IRC: Mona
  • Offline
  • Profile

Re: Autocomplete yui3

Post Posted: Tue Nov 15, 2011 12:41 pm
+0-
Thanks for your quick reply but i am not able to do animation on autocomplete list its working on my input textbox.

Could you suggest me more for the same.

Thanks & Regards,
Mona

Mona Patel

  • Username: mona_patel
  • Joined: Mon Nov 14, 2011 1:22 pm
  • Posts: 16
  • GitHub: Mona
  • Gists: Mona
  • IRC: Mona
  • Offline
  • Profile

Re: Autocomplete yui3

Post Posted: Thu Nov 17, 2011 12:58 pm
+0-
created animation for autocomplete and added animation into visible change event,

Y.one('#q').ac.on('visibleChange', function (e) {

var b = Y.one(".yui3-aclist-content");
b.setStyle('height', MaxHeight);
var ListClientHeight = Y.one('.yui3-aclist-list')._node.clientHeight;
var ContentClientHeight = b._node.clientHeight;

if (ListClientHeight < ContentClientHeight) {
theight = ListClientHeight;
}
else {
theight = ContentClientHeight;
}
var anim = new Y.Anim({
node: '.yui3-aclist-content',
from:
{
height: lastheight
},
to:
{
height: theight + 3
},
//easing: Y.Easing.backOut,
duration: 0.5
});
lastheight = theight;
anim.run();
});
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum