javascript - Slide image with easing -


The idea is that images appearing on the page in a sliding way (sliding in place) and that part I managed Make.

What I do not think is able to achieve, they have to add some kind of ease - for example the image should go faster in the beginning and slows down before reaching its destination. >

I have been the first part to work on my website, but I have not made anything in Bella - anyway, this is:

HTML:

 < code> & lt; Div id = "click-me" & gt; & Lt; Div id = "square" & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

CSS: # click- I {width: 1000px; Height: 1000px; } #square {status: relative; Left: 300px; Height: 100 pixels; Width: 100px; Background color: orange; }

JS:

 Click  $ ('# click-me') (function (e) {e.preventDefault (); $ (' #square '). Chetan ({left: 0}, 500);});   

Can someone suggest me? I am a newbie in jquery

commenter said - as you're missing from jQuery, that's why it does not work Does.

Outside the jQuery box comes with 2 different easy options, swing (default) and linear, as the name suggests is stable.

However, there is a great library for various easy options, which you can plug - a link and you can try different types of pages. Download it, add it to your website (after jQuery) and you can use different intuitive ways.

To use ease in your code, simply add the type of ease after the period.

  $ ("# element"). Chetan ({"left": 0, 1000, "ease");    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -