Ok, I've kind of got it working, using jQIW as a template. You'll notice that as you pass the mouse over the image, it will shake, like it's trying to open. If you move your mouse to the center of the image and leave it in just the right position and let the mouse stop, the image will expand. As soon as you move the mouse it will collapse. I'd really like it to work - if the mouse is anywhere on the image, it's open, if you click the image, open or not, it will follow the link, when the mouse is not on the image, the image will collapse. Here is the function code I've modified from the addEffect function.
Code:
$target.mouseover(function(e){
var $this=$(this).css({opacity:setting.imgopacity[0]})
var imageinfo=jQuery.imageWarp.warpshells[$(this).data('pos')]
jQuery.imageWarp.refreshoffsets($this, imageinfo) //refresh offset positions of original and warped images
var $clone=imageinfo.$clone
$clone.stop().css({left:imageinfo.attrs.x, top:imageinfo.attrs.y, width:imageinfo.attrs.w, height:imageinfo.attrs.h, opacity:setting.warpopacity[1], visibility:'visible'})
.animate({left:imageinfo.newattrs.x, top:imageinfo.newattrs.y, width:imageinfo.newattrs.w, height:imageinfo.newattrs.h}, setting.duration,
function(){ //callback function after warping is complete
$clone.css({left:imageinfo.newattrs.x, top:imageinfo.newattrs.y, opacity:setting.imgopacity[1], visibility:'visible'})
$this.css({opacity:setting.imgopacity[1]})
}) //end animate
}) //end mouseover
$target.mouseout(function(e){
var $this=$(this).css({opacity:setting.imgopacity[0]})
var imageinfo=jQuery.imageWarp.warpshells[$(this).data('pos')]
jQuery.imageWarp.refreshoffsets($this, imageinfo) //refresh offset positions of original and warped images
var $clone=imageinfo.$clone
$clone.stop().css({left:imageinfo.newattrs.x, top:imageinfo.newattrs.y, width:imageinfo.newattrs.w, height:imageinfo.newattrs.h, opacity:setting.warpopacity[1], visibility:'hidden'})
.animate({left:imageinfo.attrs.x, top:imageinfo.attrs.y, width:imageinfo.attrs.w, height:imageinfo.attrs.h}, setting.duration,
function(){ //callback function after warping is complete
$clone.css({left:0, top:0, visibility:'hidden'})
$this.css({opacity:setting.imgopacity[0]})
}) //end animate
}) //end mouseover
I can't figure out why it's so unstable. Adding $clone.stop(true,true) doesn't help.
Bookmarks