使用包含幻燈片,菜單和傳送帶的JQuery
模板處理anugularjs
項目。我如何在angularjs
中嵌入JQuery
處理渲染的主腳本。在Angularjs中嵌入JQuery
我這樣做:
$scope.load = function() {
jQuery('#tp-banner').show().revolution({
dottedOverlay: "none",
delay: 6000,
startwidth: 1170,
startheight: 700,
hideThumbs: 200,
thumbWidth: 100,
thumbHeight: 50,
thumbAmount: 5,
navigationType: "bullet",
navigationArrows: "solo",
navigationStyle: "square",
touchenabled: "on",
onHoverStop: "off",
swipe_velocity: 0.7,
swipe_min_touches: 1,
swipe_max_touches: 1,
drag_block_vertical: false,
parallax: "mouse",
parallaxBgFreeze: "on",
parallaxLevels: [7, 4, 3, 2, 5, 4, 3, 2, 1, 0],
keyboardNavigation: "off",
navigationHAlign: "center",
navigationVAlign: "bottom",
navigationHOffset: 0,
navigationVOffset: 20,
soloArrowLeftHalign: "left",
soloArrowLeftValign: "center",
soloArrowLeftHOffset: 20,
soloArrowLeftVOffset: 0,
soloArrowRightHalign: "right",
soloArrowRightValign: "center",
soloArrowRightHOffset: 20,
soloArrowRightVOffset: 0,
shadow: 0,
fullWidth: "on",
fullScreen: "off",
spinner: "spinner4",
stopLoop: "off",
stopAfterLoops: -1,
stopAtSlide: -1,
shuffle: "off",
autoHeight: "off",
forceFullWidth: "off",
hideThumbsOnMobile: "off",
hideNavDelayOnMobile: 1500,
hideBulletsOnMobile: "off",
hideArrowsOnMobile: "off",
hideThumbsUnderResolution: 0,
hideSliderAtLimit: 0,
hideCaptionAtLimit: 0,
hideAllCaptionAtLilmit: 0,
startWithSlide: 0,
videoJsPath: "rs-plugin/videojs/",
fullScreenOffsetContainer: ""
});
}
$scope.load();
在上面的代碼中,我試圖嵌入使用控制器滑塊,但它未加載。
你有沒有得到任何錯誤?你可以檢查鉻/ Firefox控制檯,看看是否有任何錯誤? –
這需要放入一個指令中,以便確保在代碼運行時存在元素。 DOM代碼不屬於控制器 – charlietfl
沒有任何錯誤與幻燈片有關。 – uikrosoft