I have a series of panels that I'd like to animate from random positions with jQuery.
Basically, I want a series of panels with random 'top', 'right', 'bottom', 'left' propertie开发者_如何转开发s. In effect, I want some panels to slide in from the top, some from the left etc.
I've made a start, but am struggling to figure out how I'd go about getting the current elements css position property, i.e. top, bottom, left or right. Bear in mind I want the property, not the value.
Any ideas how I could achieve this?
jQuery's .animate()
does not require you to know the current position of an element. You provide a map of CSS properties the element will move toward, and .animate()
handles the rest.
精彩评论