Solved

jquery fade() not working.  ASP.NET

Posted on 2015-01-22
3
187 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)

910 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

16 Experts available now in Live!

Get 1:1 Help Now