Skip to content

Commit

Permalink
value of size_y determined just once
Browse files Browse the repository at this point in the history
  • Loading branch information
bganicky committed May 6, 2009
1 parent 92d62e8 commit 0e2080e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jquery.hoverpulse.js
Expand Up @@ -22,6 +22,8 @@ $.fn.hoverpulse = function(options) {

var opts = $.extend({}, $.fn.hoverpulse.defaults, options);

// if not modified size_y is same as size
opts.size_y = opts.size_y || opts.size;
// parent must be relatively positioned
this.parent().css({ position: 'relative' });
// pulsing element must be absolutely positioned
Expand All @@ -43,9 +45,9 @@ $.fn.hoverpulse = function(options) {
var size = $this.data('hoverpulse.size');
var w = size.w, h = size.h;
$this.stop().animate({
top: opts.size_y ? ('-'+opts.size_y+'px') : ('-'+opts.size+'px'),
top: ('-'+opts.size_y+'px'),
left: ('-'+opts.size+'px'),
height: opts.size_y ? (h+2*opts.size_y)+'px' : (h+2*opts.size)+'px',
height: (h+2*opts.size_y)+'px',
width: (w+2*opts.size)+'px'
}, opts.speed);
},
Expand Down

0 comments on commit 0e2080e

Please sign in to comment.