Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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:

XML
<%@ 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>



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?
Posted
Updated 12-Jul-13 7:45am
v3
Comments
lewax00 12-Jul-13 13:41pm    
Are your jQuery and jQuery UI scripts actually in different folders? Because they're pointing to different paths.
Pratik Gaikwad 12-Jul-13 13:48pm    
I have edited my question. Made correction in the path. I am able to attach debugger.But not sure what is wrong? How do i check browser console?
lewax00 12-Jul-13 14:09pm    
But did you fix that on your page? Could be related.

As for debugging JS:
Firefox: Ctrl+Shift+K
IE: F12
Chrome: (from comment below, I don't have it installed) Ctrl+Shift+I

Any of those should give you the errors from JS.
Pratik Gaikwad 12-Jul-13 14:22pm    
It is by default installed in chrome (atleast for me) ....
lewax00 12-Jul-13 14:23pm    
I mean I don't have Chrome installed. I know it has a debug console by default, I just can't confirm the shortcut.

1 solution

Found my own mistake. It was IE9's compatible view which was preventing proper running of code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900