【发布时间】:2013-08-06 01:55:22
【问题描述】:
我已经下载并设置了 jQuery 照明(http://www.tonylea.com/2011/jquery-illuminate/)
我确保页面中加载了 jQuery 和Illumination 插件。
然后我这样编码
Javascript 部分
window.onload = function(){
if(document.URL.indexOf("mode=1") >= 0){
var input = $(".box#input");
$(document).scrollTop(input .offset().top - 60);
var v = input.val();
input.val('');
input.focus().val(v);
input.focus()
$(".btn#illuminate").illuminate({
'intensity': '0.3',
'color': '#98cb00',
'blink': 'true',
'blinkSpeed': '1200',
'outerGlow': 'true',
'outerGlowSize': '30px',
'outerGlowColor': '#98cb00'
});
}
}
表单部分
<div class="chat">
<form accept-charset="UTF-8" action="/comments" class="new_comment" data-remote="true" id="new_comment" method="post"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="GujuDnihu2UXCbJgbooDxoikjcJncFLf8hl4=" /></div>
<div class="input-append">
<input class="box" id="input" name="comment[body]" type="text" value="Hello there" />
<button type="submit" class="btn" id="illuminate">submit</button>
</div>
</form>
</div>
但是,提交按钮不会亮起。
我看到了 e.css(...) is undefined illuminate.js
的错误
为什么?我该如何解决这个问题?
【问题讨论】:
-
你确定这些是有效的 jQuery 选择器吗?
-
illuminate 和 jQuery 的加载顺序是否正确?
-
所以你已经按顺序包含了 jQuery、jQuery UI 和 Illuminate?
-
行 "input.focus()" 需要一个分号 (;) 在它的末尾。
-
介意制作小提琴吗?将使调试更容易
标签: javascript jquery html jquery-ui twitter-bootstrap