I'm using a jQuery div rotator like this one: http://jsfiddle.net/kDSqB which is working very nicely in the Fiddle. When I move the same code over to my WordPress website, it doesn't work.
I tried adding jQuery no conflict, adding a DOM document ready, and changing the $(document.body) to the name of the parent div. None of these worked.
I also tried moving all of the pertaining jQuery inline to the part of the page where the code would appear, but still the div does not rotate. What should I do?
Below is all the code for this on my WordPress website:
<script src="https://code.jquery.com/jquery-1.10.1.js">
<script type="text/javascript">
jQuery.noConflict();
$(document).ready(function(){
var $cog = $('#cog'),
$body = $(document.body),
bodyHeight = $body.height();
$(window).scroll(function () {
$cog.css({
'transform': 'rotate(' + ($body.scrollTop() / bodyHeight * 360) + 'deg)'
});
});
});
});
</script>
<div class="cogclass"><div id="cog"></div></div>