Solved

jquery fade() not working.  ASP.NET

Posted on 2015-01-22
3
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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)

734 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