Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Giving bouncing effects to the image without changing its position on the page.

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #45249
    PSP
    Participant

    Hi Friends,

    I have an image on the page, now I want to add some bouncy or spring motion effects to the image, I know this is very easy but my idea is to do this effect without changing the image position on the screen, I mean consider image has four corners (x1,y1)(x2,y1)(x2,y2)(x1,y2),
    now i want to add those effects without changing these coordinates of image.

    I tried in this way: animate the css property of increasing the height and clipping the image to those coordinates on the page(used setInterval). It’s looks like bouncing but looks little weird because of clipping.

    Any suggestion or idea?

    Thanks in advance.

    #136678
    Jozsef K.
    Participant

    Can’t say that it’s clear to me what you want to achieve.You could try animating transform:scale() rule.

    Something similar you can find here:
    http://cssdeck.com/labs/css-bouncing-bubble-balls

    #136701
    Paulie_D
    Member
    #136832
    PSP
    Participant

    Those demos move object, but for me the top and bottom edge of the image should be fixed to the screen.

    #136834
    Paulie_D
    Member

    @PSP In the box-shadow demo the image is not moving at all…it just looks like it is.

    #136835
    CrocoDillon
    Participant

    With `transform: scale(…)` the box of the image is preserved as well so it doesn’t influence other elements around it.

    #136837
    Paulie_D
    Member

    My codepen updated to demonstrate `transform:scale` also.

    #136852
    PSP
    Participant

    I tried with transform:scale also but i could not achieve my requirements.
    It should look like top and bottom “edge” is fixed.

    #136853
    unasAquila
    Participant

    Your looking for a Bloat effect?

    #136854
    CrocoDillon
    Participant

    You can’t have top and bottom fixed, and change height, all that without clipping.

    Try `transform: scale(1.25, 1)`

    #136856
    unasAquila
    Participant

    could you provide an image with the states you require.

    #136859
    Paulie_D
    Member

    Added a zoom effect to Codepen.


    @PSP
    To be honest, I think we need to see ‘before’ & ‘after’ examples of what you are trying to achieve.

    EDIT: See @unasAquila has just posted the same request.

    #137632
    PSP
    Participant

    Sorry because I do not have any image to show it. I can explain it in more clear way.
    Consider a spring which is fixed on both the sides, I mean both end of spring is fixed to the certain points, now I want to pull it from the middle, so that it will be giving bouncing effect still both ends are fixed.

    #137686
    Jozsef K.
    Participant

    Like a piece of material, blanket, that is blown by the wind, so you see the ripples only? So actually you want a ripple/wawe effect?

    #137688
    PSP
    Participant

    Yes.. Kind of… Thanks for understanding

Viewing 15 posts - 1 through 15 (of 18 total)
  • The forum ‘CSS’ is closed to new topics and replies.