2014-04-10 38 views
0

我首先嚐試了在https://jqueryui.com/slider中提到的源代碼(通過創建HTML)。我能夠在瀏覽器中看到滑塊。接下來,我想通過遵循http://www.andrehonsberg.com/article/meteorjs_jquery_sliders_use_document_ready文檔,使用MeterorJS顯示相同的滑塊。類型錯誤::我不斷從DEPS afterFlush功能的功能越來越「異常對象[對象的對象]無方法 '滑塊'爲什麼我無法在MeteorJS中創建jQuery UI控件?

<template name="hello"> 
<div id="slider"></div> 
</template> 

我添加了參考以及

<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> 
<script src="//code.jquery.com/jquery-1.10.2.js"></script> 
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> 

的javascript:

Template.hello.rendered = function() { 
$("#slider").slider(); 
} 

不知道我在做什麼錯在這裏。

**編輯,我也加入jQuery的UI使用mrt添加仍然不工作,但現在異常已經消失。

回答

1

不要添加引用,而是使用meteorite smart package for jquery-ui

mrt add jquery-ui 
+0

只看見自己的編輯你試過這個! –

+0

是的,我嘗試了日期選擇器,它出現了。所以我認爲,這可能與我如何初始化滑塊有關。但我接受你的答案。 – Nair

相關問題