A Pen by Edward Lance Lorilla on CodePen.
Last active
May 9, 2022 08:49
-
-
Save edwardlorilla/3aeb8f7ee39ba8d5f250f7cf743274ac to your computer and use it in GitHub Desktop.
velocity vuejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<div id="div1" ref="expandBox" class="box"></div> | |
<div ref="expandBoxTwo" class="box"></div> | |
<button @click="expandBox">expandBox</button> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el: '#app', | |
methods:{ | |
expandBox(){ | |
Velocity(this.$refs.expandBox, { | |
width: '300px' | |
}, { | |
duration: 3000 | |
}) | |
Velocity(this.$refs.expandBoxTwo, { | |
width: '300px' | |
}, { | |
duration: 3000, | |
delay: 3000 | |
}) | |
} | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.3/vue.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.5.0/velocity.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.5.0/velocity.ui.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.box{ | |
width: 100px; | |
height:100px; | |
background-color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@edwardlorilla Hi your code helped me, But can you show how I can use animation from velocity UI pack.
Like what would be Vue JS equivalent for $elements.velocity("callout.bounce");