Solved

jquery fade() not working.  ASP.NET

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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 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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

808 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