0

I am getting below error: Uncaught TypeError: $(...).unveil is not a function stuck in this.

<script type="text/javascript">
    require([
        'jquery',
        'jquerypopper',
        'jqueryunveil',
        'jquerybootstrap',
        'yttheme',
        'domReady!'
    ], function ($, Popper) {
        <?php if($enableLadyLoading){ ?>
        function _runLazyLoad() {
            $("img.lazyload").unveil(0, function () {
                $(this).load(function () {
                    this.classList.remove("lazyload");
                });
            });
        }

        /*_runLazyLoad();
        $(document).on("afterAjaxLazyLoad", function (event) {
            _runLazyLoad();
        });*/

        <?php } ?>
    });
</script>
  • share code where you have included unvail.js file – Shoaib Munir Aug 22 at 11:58
  • Have you tried 'js/jquery.unveil' instead of just 'jqueryunveil'? You may also need to "shim" unveil using requirejs.config() with "js/jquery.unveil": {deps: ["jquery"]}. – user7290573 Aug 22 at 14:32
  • i tried but no luck – imtiazau Aug 23 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.