|
|
@ -66,7 +66,7 @@ $('#container').isotope({ |
|
|
|
{% endhighlight %} |
|
|
|
{% endhighlight %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For numerical data, we can convert a text value into a number via `parseInt()` function. |
|
|
|
For numerical data, we can convert a text value into a number with `parseInt()` or `parseFloat()`. |
|
|
|
|
|
|
|
|
|
|
|
{% highlight javascript %} |
|
|
|
{% highlight javascript %} |
|
|
|
|
|
|
|
|
|
|
@ -76,7 +76,7 @@ getSortData : { |
|
|
|
return parseInt( $elem.find('.name').text(), 10 ); |
|
|
|
return parseInt( $elem.find('.name').text(), 10 ); |
|
|
|
}, |
|
|
|
}, |
|
|
|
weight : function ( $elem ) { |
|
|
|
weight : function ( $elem ) { |
|
|
|
return parseInt( $elem.find('.weight').text(), 10 ); |
|
|
|
return parseFloat( $elem.find('.weight').text() ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|