Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jquery fade() not working.  ASP.NET

Posted on 2015-01-22
3
Medium Priority
?
206 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 2000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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…
Suggested Courses

705 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