Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
What is wrong with this code that does not run on .aspx web pages
Please help me
XML
    <style>
        #Slider {
            
        }
        #Actual {
            background: silver;
            color: White;
            padding: 20px;
        }
        .slideup, .slidedown {
            max-height: 0;            
            overflow-y: hidden;
            -webkit-transition: max-height 0.8s ease-in-out;
            -moz-transition: max-height 0.8s ease-in-out;
            -o-transition: max-height 0.8s ease-in-out;
            transition: max-height 0.8s ease-in-out;
        }
        .slidedown {            
            max-height: 60px ;                    
        }    
    </style>
  </head>

  <body>
    <div class="container" style="padding: 40px">
      <button id="Trigger">Trigger Slideup/SlideDown</button>
      <div id="Slider" class="slideup">
        <div id="Actual">
                Hello World Text
            </div>
      </div>
    </div>


    <script data-require="jquery@2.0.3" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
    <script>
        
        $("#Trigger").click(function () {
          $("#Slider").toggleClass("slidedown slideup");
        });
    </script>
  </body>
</html>
Posted
Comments
CHill60 2-Jul-14 11:31am    
Describe what you mean by "does not run". What happens?
m-e-h-d-h-i 2-Jul-14 11:35am    
nothing happen on .aspx
but it work correctly on .html
Sergey Alexandrovich Kryukov 2-Jul-14 13:52pm    
What is that supposed to mean?
All such questions make little to no sense unless you describe what do you want to achieve.
—SA
m-e-h-d-h-i 2-Jul-14 11:34am    
nothing happen on .aspx
but it work correctly on .html
m-e-h-d-h-i 2-Jul-14 11:40am    
How can i use jquery plugin?

1 solution

The problem is with this tag <button id="Trigger">Trigger Slideup/SlideDown</button>

in Asp.net we can use
<asp:Button ID="Button1" runat="server" Text="Button"/>
for server control or
<input type="button" id="Button1" value="Search" />
for html control.

so try to replace <button id="Trigger">Trigger Slideup/SlideDown</button> to
<asp:Button ID="Button1" runat="server" Text="Button"/>
or to this
<input type="button" id="Button1" value="Search" />
based on your requirement.
 
Share this answer
 
Comments
m-e-h-d-h-i 3-Jul-14 6:35am    
<input type="button" id="Trigger" value="Search" />
This work
thanks...
Chakravarthi Elchuri 3-Jul-14 6:43am    
please rate if your problem solved

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900