In Meteor JS, how to control Javascript load order in relation to DOM load order? For animations

后端 未结 5 572
孤独总比滥情好
孤独总比滥情好 2021-01-03 07:48

I\'ve got a template that I downloaded:

http://halibegic.com/projects/merlin/

I want to use it in Meteor and I\'m having major issues with

&         


        
5条回答
  •  礼貌的吻别
    2021-01-03 08:05

    I've used this pattern

    Template.layout.created = function() {
        var jsLibs = [
            'vendors/Flot/jquery.flot.js',
            'vendors/Flot/jquery.flot.pie.js',
            'vendors/Flot/jquery.flot.pie.js',
            'vendors/Flot/jquery.flot.pie.js',
            'vendors/Flot/jquery.flot.pie.js',
            'vendors/Flot/jquery.flot.pie.js',
            'vendors/Flot/jquery.flot.pie.js',
            'vendors/Flot/jquery.flot.pie.js',
            'vendors/Flot/jquery.flot.time.js',
            'vendors/Flot/jquery.flot.stack.js',
            'vendors/Flot/jquery.flot.resize.js',
            'js/flot/jquery.flot.orderBars.js',
            'js/flot/curvedLines.js',
            'js/flot/date.js',
            'js/flot/jquery.flot.spline.js',
            'js/flot/curvedLines.js',
    
            'vendors/bootstrap/dist/js/bootstrap.min.js',
            'vendors/bootstrap/dist/js/bootstrap.min.js',
            'vendors/fastclick/lib/fastclick.js',
            'vendors/nprogress/nprogress.js',
            'vendors/Chart.js/dist/Chart.min.js',
            'vendors/bernii/gauge.js/dist/gauge.min.js',
            'vendors/bootstrap-progressbar/bootstrap-progressbar.min.js',
            'vendors/iCheck/icheck.min.js',
            'vendors/skycons/skycons.js',
            'js/maps/jquery-jvectormap-2.0.3.min.js',
            'js/moment/moment.min.js',
            'js/datepicker/daterangepicker.js',
            'build/js/custom.min.js',
            'js/maps/jquery-jvectormap-world-mill-en.js',
            'js/maps/jquery-jvectormap-us-aea-en.js',
            'js/maps/gdp-data.js'
        ];
    
        jsLibs.forEach((lib) => {
            $('head').append(`
    
                                     
                  
提交回复
热议问题