如果我将它直接放在 index.html 页面中,进度条正在工作。但是如果我将它放在具有“使用严格”模式的外部 active.js 文件中,它就不起作用(动画)。但其他 JS 工作正常。请帮我。提前致谢。下面是我的代码:
$('[data-toggle="tooltip"]').tooltip({ 触发器:'手动' }).tooltip('show'); $(window).on('scroll', function () { if ($(window).scrollTop() > 500) { // 向下滚动并获取操作 $(".progress-bar").each(function() { each_bar_width = $(this).attr('aria-valuenow'); $(this).width(each_bar_width + '%'); }); } });
Details code here: https://codepen.io/valencia123/pen/aOopQx