Reputation: 2382
I'm new to jQuery and learning it to integrate with ASP.NET.
The following is throwing an exception as "Invalid argument".
<script type="text/javascript">
$(document).ready(
function () {
$("h2:first").animate({
borderBottom: '3px solid #8f8f8f',
borderRight: '3px solid #bfbfbf'
}, 2000);
}
);
.....
<h2>
Welcome to ASP.NET!
</h2>
Thank you & regards
Upvotes: 1
Views: 78
Reputation: 105071
You're trying to animate more than one dimension per property.
All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality. (For example,
width
,height
, orleft
can be animated butbackground-color
cannot be.) Property values are treated as a number of pixels unless otherwise specified. The units em and % can be specified where applicable.
You have to set values one property at a time like borderBottomWidth: 3
. The problem is also that provided animation capability isn't able to animate colours as is. You have to resort to other means to do that.
The jQuery UI project extends the
.animate()
method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.
Upvotes: 2