The error has been tricky issue. Most jQuery functions operate on zero or more elements in a jQuery collection. However, some methods only operate on the first matched element and return some value. If a script is depending on a value from the offset method, there will be an error somewhere. I'm just trapping the error, otherwise it is very cryptic to those who haven't seen it before. returning anything like 0 instead of an error would just cause even more confusion because it would look like it was reporting a height or width of 0.
Thanks for the feedback! :)
--
Brandon Aaron
<div><span class="gmail_quote">On 8/13/07, <b class="gmail_sendername">Michael Schwarz [MVP]</b> <<a href="mailto:michael.schwarz@gmail.com">
michael.schwarz@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,
I love this, as I did a very similar plugin. Well, the only thing I
don't like is the error() in all methods. Maybe it should return 0
instead, and somewhere else the plugin could be configured to throw an
exception or return 0.
Michael
On Aug 13, 6:34 am, "Brandon Aaron" <
<a href="mailto:brandon.aa...@gmail.com">
brandon.aa...@gmail.com</a>> wrote:
> I just released Dimensions 1.1. It includes an option to include margin for
> the outerWidth and outerHeight methods. I've also fixed the issues with
> Safari 3 and the offset method. The docs have also been udpated for 1.1. As
> usual you can grab the latest from the Dimensions project page. Note that
> this update requires jQuery 1.1.3.
>
> project page:<a href="http://jquery.com/plugins/project/dimensions/">
http://jquery.com/plugins/project/dimensions/</a>> docs:<a href="http://brandonaaron.net/docs/dimensions/">
http://brandonaaron.net/docs/dimensions/</a>
>
> --
> Brandon Aaron
</blockquote></div>