Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3fdd7f4

Browse files
committed
Remove unnecessary variable from func resizer
1 parent 7ce7b61 commit 3fdd7f4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

jquery.fittext.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@
1919
var compressor = kompressor || 1; // set the compressor
2020

2121
// Resizer() resizes items based on the object width divided by the compressor * 10
22-
var resizer = function ( obj ) {
23-
obj.css('font-size', Math.min(obj.width() / (compressor*10), origFontSize));
24-
}
22+
var resizer = function () {
23+
$this.css('font-size', Math.min(obj.width() / (compressor*10), origFontSize));
24+
};
2525

2626
// Call once to set.
27-
resizer($this);
27+
resizer();
2828

2929
// Call on resize. Opera debounces their resize by default.
30-
$(window).resize(function() {
31-
resizer($this);
32-
});
30+
$(window).resize(resizer);
3331

3432
});
3533

0 commit comments

Comments
 (0)