move.js
move.js copied to clipboard
move in not defined
Hi,
I am having difficulties to set up move.js
Here is my code:
<script src="<?php echo base_url('assets/js/lib/jquery-1.11.1.min.js'); ?>"></script>
<script src="<?php echo base_url('assets/js/lib/move.min.js'); ?>"></script>
and
$('.some_selector').on('click', function() {
move('.some_selector')
.duration(1000)
.set('opacity', 1)
.add('left', 500)
.end();
});
I am getting following errors:
move.min.js:1 Uncaught TypeError: Cannot read property 'style' of null
main.js:60 Uncaught ReferenceError: move is not defined
Can you please provide some assistance?
Same problem here. Resolved by including the script
tag in the body instead of the head of the html.
When MoveJS included before body
element it fails to initialize, because it tries to access document.body.style
which isn't yet created. Strange that such behavior is not covered by docs.
Confirmed, moving script tag to body resolved it indeed.