wimbarelds / TimeCircles

jQuery plugin to show time since or time until a specific time
296 stars 149 forks source link

timecircles is not a function #137

Open zinoadidi opened 6 years ago

zinoadidi commented 6 years ago

USing timeCircles with Cordova on init an error occurs:

$(...).TimeCircles is not a function.

<script type="text/javascript" src="app/assets/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="app/assets/timecircles/timeCircles.js"></script>    
<script type="text/javascript" src="app/assets/js/vue.js"></script>

     $(".gameTimer").TimeCircles({
        start: true,
        animation_interval: "smooth",
        circle_bg_color: '#090c0f',
        direction: "Counter-clockwise",
        count_past_zero: false,
        time: {
            Days: { show: false },
            Hours: { show: false },
            Minutes: { show: false },
            Seconds: { show: true, color: '#' + generateColor() }
        }
    });
    /* $(".gameTimer").TimeCircles().addListener(function (unit, value, total) {
        if (total <= 0) submitAnswer('timer');
    }); */

works fine on the desktop browser but this error shows when on a mobile device; *Testing on chrome

wimbarelds commented 6 years ago

Can you confirm the files are being loaded?

zinoadidi commented 6 years ago

yes, they are been uploaded. Attempted to include them twice just to confirm that they are getting there which I was able to establish. like I said, works fine on chrome but doesn't work on mobile devices and also in the app itself when packaged.

wimbarelds commented 6 years ago

Are you perhaps loading jQuery twice also? How are you checking that the TimeCircles script was loaded? Also can you check in dev console (using chrome://inspect) whether or not the code works from there?