Uncaught TypeError: $(…).tooltip is not a function

后端 未结 4 742
悲哀的现实
悲哀的现实 2021-01-12 00:34

I have a project based in Spring Web model-view-controller (MVC) framework. The version of the Spring Web model-view-controller (MVC) framework is 3.2.8 deployed on a WebLog

4条回答
  •  死守一世寂寞
    2021-01-12 01:01

    Because jQuery 3.5.1 is getting larger it takes more time to load, in addition to the ordering of the JavaScript files, mentioned in many answers to this question, the way to go in addition to fixing the order which by the way does not always work, for Bootstrap tooltip option, a work around is to use a timeout based on jQuery loading time, example:

    setTimeout(function () {
            $("[title]").tooltip({
                container: "body",
                placement: "top",
                delay: { show: 240, hide: 60 }
            });
    
            $("[title]").on("click", function () {
                $(this).tooltip("hide");
            });
        }, 545*1.33); // 545ms timing to load jQuery.js + network estimated delay 
    

提交回复
热议问题