Reputation: 8026
In my angularjs directive I want to increase DIV width if vertical scroll bar is visible. I did the following with jQuery:
var gridBody = gridElem.children().eq(1);
var scrollBarWidth = gridBody[0].offsetWidth - gridBody[0].clientWidth;
var lastCol = angular.element(gridElem[0].querySelector('.grid-header-last-cell'));
lastCol.width(lastCol.width() + scrollBarWidth);
It seems to work (not sure about cross browser issues). Notice that width() method is jQuery method but jqLite. How can I achieve the same result with jqLite only?
Upvotes: 0
Views: 967
Reputation: 8026
The following worked:
lastCol.css('width', '+=' + scrollBarWidth);
Upvotes: 1