Uncaught TypeError: $ is not a function
<script id="rendered-js">
var transformElm = function ($elm, $val) {
$elm.css({
'-moz-transform': $val,
'-ms-transform': $val,
'-o-transform': $val,
'transform': $val,
'-webkit-transform': $val });
};
var watchDoubleGear = function () {
var $doc = $(document);
$doc.on('scroll', function () {
var $doubleGear = $('.double-gear'),
$innerGear = $doubleGear.find('.inner-gear'),
$outerGear = $doubleGear.find('.outer-gear'),
st = $doc.scrollTop(),
igRotate,ogRotate;
// $self.initRotateAttr($innerGear);
//$self.initRotateAttr($outerGear);
transformElm($innerGear, 'rotate(' + st * -1 + 'deg)');
transformElm($outerGear, 'rotate(' + st / 5 + 'deg)');
});
};
watchDoubleGear();
</script>
var $doc = $(document);
watchDoubleGear();
<script id="rendered-js">
(function ($) {
$(document).ready(function () {
var transformElm = function ($elm, $val) {
$elm.css({
'-moz-transform': $val,
'-ms-transform': $val,
'-o-transform': $val,
'transform': $val,
'-webkit-transform': $val});
};
var watchDoubleGear = function () {
var $doc = $(document);
$doc.on('scroll', function () {
var $doubleGear = $('.double-gear'),
$innerGear = $doubleGear.find('.inner-gear'),
$outerGear = $doubleGear.find('.outer-gear'),
st = $doc.scrollTop(),
igRotate, ogRotate;
// $self.initRotateAttr($innerGear);
//$self.initRotateAttr($outerGear);
transformElm($innerGear, 'rotate(' + st * -1 + 'deg)');
transformElm($outerGear, 'rotate(' + st / 5 + 'deg)');
});
};
watchDoubleGear();
});
})(jQuery);
</script>