我已经给出了一些我需要用于离子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项目中。 –