Solved

jquery fade() not working.  ASP.NET

Posted on 2015-01-22
3
183 Views
Last Modified: 2015-01-22
Hi Experts - Here's my code that is NOT working:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Fade.aspx.vb" Inherits="Fade" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Fade Test</title>
    <script src="scripts/jquery-1.11.1.min.js"></script>
    <script>
        $('#mydiv').fadeOut(3000)
        $('<%= myPanelDiv.ClientID%>').fadeOut(3000)
        
    </script>
</head>
<body>
    <form id="form1" runat="server">

        <div id="mydiv">
            My First Box
        </div>

        <asp:Panel ID="myPanelDiv" runat="server">
            My Panel Box
        </asp:Panel>

    </form>
</body>
</html>

Open in new window


As you can see, I have two objects I'm trying to fade; a standard HTML div tag and a ASP.NET Panel.  Regardless, neither of them fade.  Can someone please fix my code.  Thanks!
0
Comment
Question by:cdemott33
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Jesus Rodriguez earned 500 total points
ID: 40564612
Try this

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Fade.aspx.vb" Inherits="Fade" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Fade Test</title>
    <script src="scripts/jquery-1.11.1.min.js"></script>
    <script>
        $(document).ready(
                                          function () { 
                                            $('#mydiv').fadeOut(3000);
                                            $('#pnlHelloWorld').fadeOut(3000);
                                         });        
    </script>
</head>
<body>
    <form id="form1" runat="server">

        <div id="mydiv">
            My First Box
        </div>

        <asp:Panel ID="myPanelDiv" runat="server">
            My Panel Box
        </asp:Panel>

    </form>
</body>
</html>

Open in new window

0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 40564616
Check this for reference on the fade in and out for panels

http://www.dotnetcurry.com/showarticle.aspx?ID=313
0
 

Author Closing Comment

by:cdemott33
ID: 40564831
Excellent.  Thank you!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now