implemented $.fn.scrollParent (candidate for jQuery core, see ticket #3589 in Jquery's trac)

This commit is contained in:
Paul Bakaus 2008-11-10 14:32:25 +00:00
parent 3206b611b1
commit ffa5f16169

View File

@ -169,6 +169,12 @@ $.fn.extend({
.attr('unselectable', 'on') .attr('unselectable', 'on')
.css('MozUserSelect', 'none') .css('MozUserSelect', 'none')
.bind('selectstart.ui', function() { return false; }); .bind('selectstart.ui', function() { return false; });
},
scrollParent: function() {
return $(this).parents().filter(function() {
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
}).eq(0);
} }
}); });