如何使用Jquery发光标签文本 [英] How to glow label text using Jquery
本文介绍了如何使用Jquery发光标签文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 http://jsfiddle.net/Jf4vB/211/ 中提供的代码。代码在小提琴中完美运行但是当我尝试在我的projuect中执行相同的代码时,我没有得到发光效果
我的代码如下:
I am trying to use code given at http://jsfiddle.net/Jf4vB/211/. The code runs perfectly in fiddle but when I trying to excute same code in my projuect I am not getting that "Glow Effect"
My code is as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.red {
font-size: 50px;
color: #c61a1a;
cursor: pointer;
}
</style>
<script type="text/javascript" src="Scripts/jquery-1.7.1.js"></script>
<script type="text/javascript" src="Scripts/jquery-ui-1.8.20.js"></script>
<script type="text/javascript">
$(function () {
var red = $(".red");
var v = $('#btn');
$.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 + (end - start) * (fx.pos));
$(fx.elem).css("text-shadow", "0px 0px " + now + "px #c61a1a")
.data("last-glow", now);
},
complete: callback
});
};
v.click(function () {
red
.stop()
.glowEffect(0, 50, 1000,
function () {
$(this).glowEffect(50, 0, 1000);
});
});
});
</script>
<style type="text/css">
.red {
font-size:50px;
color:#c61a1a;
cursor:pointer;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div class="red">Here is my text.</div>
<button type="button" id="btn">Click Me!</button>
</form>
</body>
</html>
< br $> b $ b
我也在修改上面的代码,使用asp按钮和复选框文本发光。但是我仍然无法得到效果我我在找。
任何人都可以帮助我吗?
I am also modifying above code to use asp button and text of checkbox to glow.But I am still unable to get the effect I am looking for.
Can anyone please help me?
推荐答案
(函数(){
var red =
(function () { var red =
( 。red);
var v =
(' #btn');
这篇关于如何使用Jquery发光标签文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文