我已經給出了一些我需要用於離子2項目的JQuery代碼。我怎樣才能包含它和JQuery庫?在離子2中使用JQuery
的代碼看起來是這樣的(這只是其中的一部分):
// on 'Left Down' button click:
jQuery('body').on('click', '.left-down', function (e) {
\t jQuery('body #top-scale').stop();
\t jQuery('body .right-hand-weight').stop();
\t jQuery('body .left-hand-weight').stop();
\t //top of scale animation
\t jQuery("body #top-scale").animate({
\t \t transform: "rotate("+ setWeights(3,0) +"deg)"
\t })
\t
\t \t //===rotate + reposition each weight ***
\t \t jQuery("body .right-hand-weight").animate({
\t \t \t transform:"rotate("+ getWeights() +"deg) translateX("+getX("right")+"px,"+getY("right")+"px)"
\t \t })
\t \t jQuery("body .left-hand-weight").animate({
\t \t \t transform:"rotate("+ getWeights() +"deg) translateX("+getX("left")+"px,"+getY("left")+"px)"
\t \t })
\t \t //console.log(getWeights());
\t \t // set number value in weight
\t \t jQuery("body .text-1").text(leftWeightPercentage);
});
我想將一個腳本SRC標籤中的index.htm的jQuery庫和我已經給出的jquery代碼文件,但我不知道如何將代碼導入到我的ionic 2項目中。
我正在考慮在index.htm中爲jQuery庫和jquery代碼文件添加腳本src標記,但我無法弄清楚如何將代碼導入到我的ionic 2項目中。 –