向下滑动div标签 [英] Sliding Down a div tag
问题描述
大家好,
现在,我正在使用Framework 4.0在ASP.Net中创建一个网站.单击asp:Button时,我必须向下滑动div,我将脚本编写为
Hi everyone ,
Now I''m creating a website in ASP.Net with framework 4.0 . I have to slide down a div when I click a asp:Button , i wrote script as
<script type="text/javascript">
$(document).ready(function () {
$('#<%= Button1.ClientID %>').click(function () {
$('div#content').show('slow');
}
);
});
</script>
并且按钮创建为
and button is created as
<asp:Button id="Button1" runat="server" text="Button" style ="width :auto" />
div是
and the div is
<div id ="content" style ="display :none " > this is a div</div>
问题是单击按钮后,div会自动显示和隐藏.但是当我使用按钮作为
The problem is after clicking the button the div shows and hides automatically. But when i use the button as
<input type ="button" id="Button1" runat="server" text="Button" style ="width :auto" />
然后它可以正常工作...我不知道发生了什么..请解决我的问题
谢谢大家
then it works properly ... I dont understand what is happening .. Please solve my problem
Thank you all
推荐答案
(文档).ready( function (){
(document).ready(function () {
(' #<%= Button1.ClientID%>').click(函数(){
('#<%= Button1.ClientID %>').click(function () {
( div#content').show(慢'); } ); }); </script>
('div#content').show('slow'); } ); }); </script>
并且按钮创建为
and button is created as
<asp:Button id="Button1" runat="server" text="Button" style ="width :auto" />
div是
and the div is
<div id ="content" style ="display :none " > this is a div</div>
问题是单击按钮后,div会自动显示和隐藏.但是当我使用按钮作为
The problem is after clicking the button the div shows and hides automatically. But when i use the button as
<input type ="button" id="Button1" runat="server" text="Button" style ="width :auto" />
然后它可以正常工作...我不知道发生了什么..请解决我的问题
谢谢大家
then it works properly ... I dont understand what is happening .. Please solve my problem
Thank you all
这篇关于向下滑动div标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!