greggycoding
greggycoding

Reputation: 55

scrollreveal javascript not defined

so i have this code ...

window.sr = ScrollReveal({ reset: true });

    sr.reveal('.whitecircle, .circleStatsItemBox, .circleStat', { duration: 200 });
function circle_progess() {

    var divElement = $('div'); //log all div elements

    if (retina()) {

        $(".whiteCircle").knob({
            'min':0,
            'max':100,
            'readOnly': true,
            'width': 240,
            'height': 240,
            'bgColor': 'rgba(255,255,255,0.5)',
            'fgColor': 'rgba(255,255,255,0.9)',
            'dynamicDraw': true,
            'thickness': 0.2,
            'tickColorizeValues': true
        });

        $(".circleStat").css('zoom',0.5);
        $(".whiteCircle").css('zoom',0.999);


    } else {

        $(".whiteCircle").knob({
            'min':0,
            'max':100,
            'readOnly': true,
            'width': 120,
            'height': 120,
            'bgColor': 'rgba(255,255,255,0.5)',
            'fgColor': 'rgba(255,255,255,0.9)',
            'dynamicDraw': true,
            'thickness': 0.2,
            'tickColorizeValues': true
        });

    }



        $(".circleStatsItemBox").each(function() {
  var value = $(this).find(".count > .number").html();
  var unit = $(this).find(".value > .unit").html();
  var percent = $(this).find("input").val() / 100;

  countSpeed = 2300 * percent;
  endValue = value;

  $(this).find(".count > .unit").html(unit);
  $(this).find(".count > .number").countTo({
    from: 0,
    to: endValue,
    speed: countSpeed,
    refreshInterval: 50
  });

  //$(this).find(".count").html(value*percent + unit);
});

} 

and i want to use the reveal scroll js from this link, have followed the documentation and inserted the code in the html just before body and have pasted this javascript onto the section just above the top of the code above.

window.sr = ScrollReveal({ reset: true });

sr.reveal('.whitecircle, .circleStatsItemBox, .circleStat', { duration: 200 });

it says ScrollReveal is not defined and unsure how to proceed. Any help would be very grateful for.

the console message ....

22:13:52.842 ReferenceError: ScrollReveal is not defined
<anonymous>custom.js:702
1custom.js:702:1

this js file is referenced in the html page i am targeting for this code ..

<script src="https://unpkg.com/[email protected]/dist/scrollreveal.min.js"></script>
    <!-- end: JavaScript-->

</div></div></div></div></div></div></div></div></div></div></div></div></body></html>

Upvotes: 0

Views: 1888

Answers (1)

greggycoding
greggycoding

Reputation: 55

Ok so I got it working , basically the call of the javascript file url in question needed to be above the other js files including the custom js file where the above code comes from

Upvotes: 1

Related Questions