[ 4 posts ]

Sam J.

  • Username: jedi
  • Joined: Mon Aug 20, 2012 11:52 am
  • Posts: 3
  • Offline
  • Profile
Tags:

reversing animation FROM hide TO show

Post Posted: Wed Aug 22, 2012 6:11 am
+0-
hello everyone.
i am a brand new person in yui concept, and as i previously worked with only jquery, the first thing i went for animation. turns out the show hide part was easy, but when i went to study toggle, i got "reversing" an animation.

http://yuiblog.com/sandbox/yui/3.2.0pr1 ... verse.html

i got the part where it hides the class yui3-bd. it does hide from the shown state.

can please anyone post me by manipulating that same code to make it show fro hide state. i.e. while the page has been loaded, yui3-bd is in hidden state. then on click of arrow, it shows and hence it reverses fro hide state.

i tried display:none css, but its always displayed none (doesnt toggles). i tried replacing from: with to: in the function, that too didnt worked.

paolo nesti poggi

YUI Contributor

  • Username: paolo
  • Joined: Sat Mar 14, 2009 9:53 am
  • Posts: 77
  • Location: Roskilde DK
  • GitHub: tribis
  • Gists: tribis
  • Offline
  • Profile

Re: reversing animation FROM hide TO show

Post Posted: Wed Aug 22, 2012 10:40 am
+0-
first of all use the current version of the library:
http://yuilibrary.com/yui/docs/anim/reverse.html
your link is for an outdated version of the YUI site (the method: 'query' is no longer there)

then swap the settings for 'to' and 'from', you'll see that when the animation starts, the div shrinks immediately to 0 and starts the animation from there. It is the opposite of your setting because the setting is reverted at each click, even the first one.
next you need to make the page load with the DIV already in a "shrinked" state.

Put a style of
Code:
.yui3-skin-sam #demo .yui3-bd {
    height: 0px;
}

on the page and you're set.

Sam J.

  • Username: jedi
  • Joined: Mon Aug 20, 2012 11:52 am
  • Posts: 3
  • Offline
  • Profile
Tags:

Re: reversing animation FROM hide TO show

Post Posted: Wed Aug 22, 2012 4:04 pm
+0-
yep, thanks paulo.
only thing was, height:0.
but that was not it. the direction of arrow remained the same, i had to change anim.css....

also, it would be helpful, if you could suggest me some links for beginners tutorial in yui.

paolo nesti poggi

YUI Contributor

  • Username: paolo
  • Joined: Sat Mar 14, 2009 9:53 am
  • Posts: 77
  • Location: Roskilde DK
  • GitHub: tribis
  • Gists: tribis
  • Offline
  • Profile

Re: reversing animation FROM hide TO show

Post Posted: Thu Aug 23, 2012 6:24 am
+0-
well, the site at yuilibrary.com has extensive documentation and plenty of examples, however the library is vast and versatile so it is difficult to know exactly where to start from.

I would advise you to use some hours to read all the articles under "core" and "infrastructure" (attribute, base, eventTarget, plugin and widget, I would leave model, app and view for later) , so you have an idea of what are the basic concepts in play, this will help you to better understand what the examples are all about when you try things out in practice,

then try out some examples relevant to what you want to accomplish and use those to go back and reread the basic documentation so to be able to enhance/understand things.

Maybe try building a plugin, there is a plugin template file, ready to be used under the plugin section http://yuilibrary.com/yui/docs/plugin/ or try out a component following the component extension file: http://yuilibrary.com/yui/docs/base/. Choose what to do depending on what you want to accomplish, to be able to choose you need to read about components, extensions, plugins and so on under the "infrastructure" section.

I hope this can be a starting point.

ah, just to be precise: each article has a sidemenu on the right with links to the API docs and to related examples.
  [ 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