http://jsfiddle.net/Jf4vB/211/にあるコードを使用しようとしています。コードはフィドルで完全に実行されますが、プロジェクトで同じコードを実行しようとすると、「グロー効果」が得られません
私のコードは次のとおりです。
<script type="text/javascript" src="../Scripts/jquery-1.7.1.js"></script>
<script type="text/javascript">
function changeColor(id) {
nIntervId = setInterval("flashText('"+id+"')", 1000);
}
$.fn.glowEffect = function (start, end, duration, callback) {
if (this.data("last-glow"))
start = this.data("last-glow");
return this.animate(
{
'placeholder': end
},
{
duration: duration,
step: function (now, fx) {
now = parseInt(start + (start - end) * (fx.pos));
$(fx.elem).css("text-shadow", "0px 0px" + now + "px #c61a1a").data("last-glow", now);
},
complete: callback
});
};
function flashText(id) {
var oElem = $('#'+id).find(":checkbox").next();
oElem.stop() .glowEffect(0, 50, 1000,
function () {
$(this).glowEffect(50, 0, 1000);
});
}
function stopTextColor() {
clearInterval(nIntervId);
}
</script>
<div id="divchkBox">
<asp:CheckBox ID="chkBox" runat="server" Text="hi" />
</div>
<asp:Button ID="start" Text="start" runat="server" OnClientClick="changeColor('divchkBox');" />
<asp:Button ID="stop" Text="stop" runat="server" OnClientClick="stopTextColor();" />
私が達成しようとしているのは、スタートボタンをクリックすると->チェックボックス(「こんにちは」)の横にあるテキストは、ストップボタンをクリックするまで、上記のフィドルのように継続的に効果があるはずです。