maya90 — 2013-07-12T14:07:26-04:00 — #1
I have to slide an element from one point to another.... and it has to slide in exactly 0.24 secs. from one pt to another... ;-o )
but I'll be happy if I just get it to slide for now...;-)
pullo — 2013-07-12T15:43:56-04:00 — #2
Is there any reason you don't want to use jQuery for this?
Animation is one area where jQuery excels and makes a developper's life much easier.
You can also build a custom version of jQuery and just pull in the animation functionality if it is size you are worried about.
maya90 — 2013-07-12T16:01:00-04:00 — #3
it's for a test.. they insist on plain JS... (sigh...)
but well, there was a time constraint, I had to hand in already.. but that's ok... if I can I want to figure out if I can do it over the weekend, and maybe just send it to the guy again anyway...
and of course you're right, I'm sure in real life no one in their right mind would do stuff like this with with JS...
the JS issue is slowly getting frustrating for job-seekers... a few years ago we all had to learn at least jQuery, and some other libraries (I only know jQuery....) they were all the rage, and you had to know them...
now they're going back to, oh but well, you do need to know how to do all this complicated with plain JS too, of course... it's getting ridiculous... and some job descriptions contain a mind-boggling amount of JS libraries, some weird ones I've never even heard of..... (and they do know they will never find someone who knows all of them...)
in my particular experience, every single place where I have worked in the last 4 years or so, they have used nothing but jQuery, absolutely nothing else...
thank you for your response... have a good weekend....
pullo — 2013-07-12T16:10:36-04:00 — #4
I'm off to bed now, so sorry for the short reply.
Maybe it it'll help.
Let us know how you get on.
maya90 — 2013-07-12T16:21:05-04:00 — #5
on the contrary, Pullo.... thank you for your response.... I will look @ url you posted.....
gute Nacht.... schlaf gut....:-)
maya90 — 2013-07-12T16:27:21-04:00 — #6
actually in case you're curious, here are the JS instructions:
a) When I click on the "Swap Vertical" button, the two buttons swap vertical positions in 0.24 seconds. (i.e., the bottom button moves up and the top button moves down, but both buttons retain their horizontal position.)
b) When I click on the "Swap Horizontal" button, the two buttons swap horizontal positions in 0.24 seconds.
c) The button animations should accelerate at the beginning, and should not decelerate at the end.
"accelerate"??? man, I had never even heard of "accelerating" elements with JS.....;-o
(accelerate "at the beginning".... only at the beginning... and yeah, I'll make sure I don't "decelerate" at the end....;-) man, anyone would think they write computer games or something, but they don't, they just do corporate websites...;-)
felgall — 2013-07-12T17:45:17-04:00 — #7
maya90 — 2013-07-12T17:53:38-04:00 — #8
thank you very much, felgal...
yes I know jQuery is not a separate language... I know exactly what it is.....;-) and when I try to do hard stuff in plain JS I realize how much goes on "behind the scenes" in jQuery (& other libraries too, I suppose.....)
thank you very much for the url you posted.... I can't now, but I will it check it tomorrow for sure....
thank you... have a good day....
ralphm — 2013-07-13T02:30:13-04:00 — #9
Is it really that bad? :lol: [/ot]
paul_wilkins — 2013-07-13T03:13:27-04:00 — #10
If you've used to jQuery, you would have heard of accelerating and decelerating As the term "easing".
There's a good suite of easing demos over at http://jqueryui.com/effect/#easing
maya90 — 2013-07-13T09:25:32-04:00 — #11
yes of course I have used "easing" in jQuery (mosly in conjunction with cycle plugin (there's an "easing" plugin with all sorts of transition effects...)
pullo — 2013-07-14T05:00:25-04:00 — #12
Sure is! I would use jQuery to brush my teeth if I could. Everything else is just pain and agony. :)[/ot]
Back on topic: how did you get on, Maya?
@felgall ; your demo didn't work for me in the latest Chrome.
The text just sits there, when I'm guessing it should move.
felgall — 2013-07-14T15:34:43-04:00 — #13
There are a series of tutorials there that show step by step how to build an animation script. The element in the first tutorial doesn't move - that tutorial is just showing how to build an independent element that can be made to move.
pullo — 2013-07-14T15:42:42-04:00 — #14
Oh ok. Sorry!
I just looked at the source, saw this:
var anim = new $O('myobj');
and thought I had missed something.