문제

I'm trying to set-up flipclock.js on my site however it doesn't seem to be loading no matter what I do, chrome gives me the following error:

Uncaught TypeError: Cannot call method 'FlipClock' of null

My code is laid out as follows:

<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>

<script src="/flipclock/src/flipclock/js/libs/base.js"></script>

<script src="/flipclock/compiled/flipclock.min.js"></script>

</head>



<body>

<div class="clock" style="margin:2em;"></div>

<script type="text/javascript">
jQuery(document).ready(function() { 
    var clock = $('.clock').FlipClock(new Date(2014,8,30).getTime()/1000 - new           Date().getTime()/1000, {
    clockFace: 'DailyCounter',
    countdown: true
   });
   });
  </script>

  </body>

All of the jquery files are loading just fine. I only receive that one error mentioned above. I've also tried moving the flipclock files below my body so they load after but with no luck and same error. Would appreciate some ideas on fixing this. Thanks.

도움이 되었습니까?

해결책

Try to use:

jQuery('.clock')

instead of:

$('.clock')
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top