Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

innerWidth does not account for scrollbar on safari 3.0.4


Project:Dimensions
Version:1.2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Create a div with a nested div that has a height greater than the parent div. Set the overflow on the parent div to force a scrollbar. On firefox innerWidth of the parent will not include the scrollbar's width. On safari innerWidth on the parent and child divs will be the same. The expected result from innerWidth would be that the parent div would not include the scrollbar width as reported in firefox. The following snippet of code will illustrate the problem:

function scrollbarWidth() {
// revisit: as of JQUERY 1.2.3 this does not work on safari 3.0.

var div = $('');
// Append our div, do our calculation and then remove it
$('body').append(div);
var w1 = $('div', div).innerWidth();
div.css('overflow-y', 'scroll');
var w2 = $('div', div).innerWidth();
$(div).remove();
return (w1 - w2);
}