Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix #82 re camel casing css props

  • Loading branch information...
commit b5f58f153efd324c5f28297e98e48cb66c021ab4 1 parent 68a0f61
Rebecca Murphey authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 book/part2-jquery-basics/ch03-jquery-basics.html
View
5 book/part2-jquery-basics/ch03-jquery-basics.html
@@ -537,7 +537,7 @@ <h3 class="title">
Note
</h3>
<p>
- CSS properties that normally include a hyphen need to be <em class="firstterm">camel cased</em> in JavaScript. For example, the CSS property <code class="code">font-size</code> is expressed as <code class="code">fontSize</code> in JavaScript.
+ CSS properties that normally include a hyphen need to be <em class="firstterm">camel cased</em> in JavaScript. For example, the CSS property <code class="code">font-size</code> is expressed as <code class="code">fontSize</code> when used as a property name in JavaScript. This does not apply, however, when passing the name of a CSS property to the <code class="code">$.fn.css</code> method as a string &mdash; in that case, either the camel cased or hyphenated form will work.</p>
</p>
</div>
<div class="example">
@@ -547,6 +547,7 @@ <h3 class="title">
<div class="example-contents">
<pre class="brush: js">
$('h1').css('fontSize'); // returns a string such as "19px"
+$('h1').css('font-size'); // also works
</pre>
</div>
</div>
@@ -1189,4 +1190,4 @@ <h3 class="title">
</div>
</div>
</div>
- </div>
+ </div>

0 comments on commit b5f58f1

Please sign in to comment.
Something went wrong with that request. Please try again.