padolsey-archive / jquery.fn

A collection of jQuery plugins
http://james.padolsey.com
The Unlicense
1.1k stars 723 forks source link

Proximity event broken under jQuery 1.8.0 #18

Closed ktonini closed 11 years ago

ktonini commented 11 years ago

it appears as if the proximity location is stuck to the upper left of the target div

ktonini commented 11 years ago

Fixed by changing lines 199, and 120 respectively -

    right = left + el.width();
    bottom = top + el.height();

Just a quick fix though, there's probably a better way. See http://blog.jquery.com/2012/08/16/jquery-1-8-box-sizing-width-csswidth-and-outerwidth/

padolsey commented 11 years ago

I cannot reproduce this breaking with jQuery 1.8. See http://jsbin.com/oxenow/1/ (seems to work fine)

Could you provide code which breaks it?

ktonini commented 11 years ago

Hmm, this is what I'm using -

$('#title').on('proximity', {max: 50, fireOutOfBounds: true}, function(event, proximity, distance){
    $('#titleDots').css('opacity', proximity);
});
ktonini commented 11 years ago

And here are the css properties on the #title element in case it has something to do with that, although it was behaving the same way on two instances of proximity that I had.

#title {
text-align: center;
position: relative;
margin-bottom: -45px;
top: 65px;
font-size: 18px;
text-shadow: 0 -4px 4px rgba(0, 0, 0, 0.38), 0 4px 4px rgba(0, 0, 0, 0.38);
letter-spacing: 4px;
height: 45px;
cursor: default;
-webkit-transform: translate3d(0,0,0);
}
ktonini commented 11 years ago

...so I just switched it back to outerWidth and outerHeight, and it's working fine. Strange, perhaps it had to do with a code minifying script that I was testing around the time I updated to jq1.8, I'll let you know if it happens again and if i can reproduce it.

padolsey commented 11 years ago

Cool okay, glad it's working again.