国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

angular.js - angular中加jquery,選擇器使用不了
PHPz
PHPz 2017-05-15 17:01:18
0
2
636
雷雷
PHPz
PHPz

學(xué)習(xí)是最好的投資!

全部回復(fù)(2)
小葫蘆

在引入AngularJS之前引入jQuery,AngularJS就會(huì)使用jQuery代替自帶的jqLite。
詳見AngularJS文檔

If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or jqLite.

To use jQuery, simply ensure it is loaded before the angular.js file. You can also use the ngJq directive to specify that jqlite should be used over jQuery, or to use a specific version of jQuery if multiple versions exist on the page.

放在Angular控制器里的代碼 不需要包含在$(document).ready()的回調(diào)函數(shù)里。
當(dāng)控制器代碼被執(zhí)行時(shí),文檔的ready事件早就已經(jīng)發(fā)生過了。

滿天的星座

在Angular中使用jQuery時(shí),因?yàn)橥瑫r(shí)用到了"$"符號(hào),所以需要將$委托給jQuery使用

$(document).ready(function($){
    $(".team").hover(function(){$(".shadow").css("display","block");console.log("1")},
    function(){$(".shadow").css("display","none");console.log("0")});
 
}(jQuery));
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板