A
A
Artyom Innokentiev2015-05-11 11:06:16
css
Artyom Innokentiev, 2015-05-11 11:06:16

Through what to do animation: css or jquery?

For example, you can do :hover in css and .hover() in jquery - where is it more correct to do animation in css or jquery from the side of extension and further code maintenance?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Mycolaos, 2015-05-11
@artinnok

Through css, because jquery does the same as you - defines the css style.
Let css be responsible for graphics (which is its task), and jquery for behavior. It is more intuitive and understandable to look at the style, and not to rummage through the jquery code to understand where, what and how you have defined.

A
Anna Bakurova, 2015-05-11
@Libris

jQuery is not an animation library.

M
marble, 2015-05-11
_

Look at the animation. Describe the example in more detail, please.

A
Artyom Innokentiev, 2015-05-11
@artinnok

<figure>
          <img src = "ch1.jpg"/>	
          <figcaption>
            <h1>hello</h1>
            <p>world!</p>
          </figcaption>
        </figure>
        <figure>
          <img src = "ch1.jpg"/>	
        </figure>
        <figure>
          <img src = "ch1.jpg"/>	
        </figure>

There are three pictures horizontally, when you hover over the cursor, the transparency of this particular picture (opacity) and the adjacent text (figcaption p) changes

Z
zooks, 2015-05-11
@zooks

Through CSS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question