js加载div, 元素事件不生效问题

两个js文件中,不生效

加载div的js写在info202009.js文件中,
元素事件写在lbs.js文件中,
虽然使lbs.js放在info202009.js文件之后,但是事件仍然不起作用??

<script src="__TMPL__Public/static/js/info202009.js"></script>
<script src="__TMPL__Public/xtpla/js/lbs.js"></script>

必须放在一个js文件中才生效

/***侧边手机号(隐藏/显示)***/
    var service = document.getElementById("service");
    if (service) {
        var outservice_info = '<span class="tools-phone">' +
            mobile +
            '</span>';
        service.innerHTML = outservice_info;
    }
    $('.tools-phone').hover(
        function () {
            $(this).addClass('on');
            $(this).find('a').show();
            if (!$(this).is(':animated')) {
                $(this).animate({'width': '170px', 'marginLeft': '-170px'}, 500);
            }
        },
        function () {
            $(this).animate({'width': '0', 'marginLeft': '0'}, 100, function () {
                $(this).removeClass('on')
            });
        }
    );
原文地址:https://www.cnblogs.com/wangyuyanhello/p/13734148.html