Hey dev'rs
I would like to be able to tween an image dynamically from it's current position on a mouse over event. A good example of what I want can be found here. (the nav cloud)
I haven't been able to find anything on jquery or anywhere else, so here's what I've come up with so far:
I spent all day trying variations of this model, but nothing has worked so far. I've also looked everywhere for a similar solution. Am I even on the right track here?Code:// this is the code to find the current y position (slightly altered from here) function findPosition( oElement ) { if( typeof( oElement.offsetParent ) != 'undefined' ) { for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) { posX += oElement.offsetLeft; posY += oElement.offsetTop; } return [ posY ]; } else { return [ oElement.y ]; } } // this function is called from the mouse over event with the 'findPosition' function in the 'tween from' area. (tween from jstween) function moveCurlybrace() { cbTween = new Tween(document.getElementById('galleryCurlybrace').style,'top',Tween.regularEaseOut,findPosition('galleryCurlybrace'),300,.5,'px'); cbTween.start(); }
Any help/feedback appreciated.
Thanks


Reply With Quote

Bookmarks