move.js icon indicating copy to clipboard operation
move.js copied to clipboard

move in not defined

Open ZigaVukcevicDev opened this issue 10 years ago • 3 comments

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?

ZigaVukcevicDev avatar Dec 07 '14 16:12 ZigaVukcevicDev

Same problem here. Resolved by including the script tag in the body instead of the head of the html.

benweet avatar Jan 01 '15 01:01 benweet

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.

frkd-dev avatar Jan 18 '15 14:01 frkd-dev

Confirmed, moving script tag to body resolved it indeed.

michahell avatar Mar 02 '15 17:03 michahell