html - 当我用 css3 单击 asp 按钮时,我想显示 div 结果

标签 html css

当我用 css3 慢动作点击 asp 按钮时,我想显示 div 结果,请任何人帮助我。

<div id="showdivslowly" runat="server" style="width:500px; height:200px; background-color:Blue ;display:none" >Welcome</div>

    <asp:Button ID="Button1" runat="server" Text="Button" />

最佳答案

这几乎肯定最好通过 Ajax call 在客户端完成。到服务器以获取结果并将其附加到隐藏的 div,您可以使用 CSS transitions 对其进行动画处理。或者使用 jQuery animation methods like fadeIn .因为 CSS 显示属性是 not animatable using CSS transitions , 你要么需要使用 opacity property (这将是 not be fully supported cross-browser ,尽管对于大多数用途可能已得到充分支持,并且只有动画会受到影响,而不是核心功能)或通过使用 jQuery 方法。

如果您在服务器端处理点击事件,那么浏览器将完成一个完整的页面回传,您可以使用您的服务器端代码附加 div,然后使用 CSS3 转换或 JavaScript 来完成客户端动画.

对于代码示例-

.result {
    -moz-transition: opacity 500ms ease-in-out 0s;
    -o-transition: opacity 500ms ease-in-out 0s;
    -webkit-transition: opacity 500ms ease-in-out 0s;
    transition: opacity 500ms ease-in-out 0s;    }

.result.hidden {
    display: none;
    opacity: 0;    
}

.result.shown {
    display: block;
    opacity: 1;
}

关于html - 当我用 css3 单击 asp 按钮时,我想显示 div 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27590959/

相关文章:

javascript - JS OpenSeadragon : when click on the component -> add a marker

css - 无法在 div 语句中更改表格的样式

html - CSS 多层标题

html - 我正在创建一个 chrome 应用程序来编辑纯文本,我正在使用 &lt;textarea&gt; 来完成此操作。它不会全尺寸

html - :before :after not working on the input type submit?

javascript - 密码字段获得焦点后启用表单登录按钮

html - 图片不会在父 div 中居中

html - 我正在设置一个嵌套列表,但我不知道应该使用什么样式

css - 在 Firefox 中删除范围输入中的虚线

html - 将行内 block 的文本居中