【问题标题】:JQuery Easing Not Working in asp.net mvc projectJQuery Easing 在 asp.net mvc 项目中不起作用
【发布时间】:2020-11-14 18:18:00
【问题描述】:

我正在使用下面的代码在我的网页上显示一些动画效果的数据

    .done(function (response) {
     $(".loadig-overlay").hide();
                $('#Container').toggle('slide', {
                     direction: 'left'
                 }, 250, function () {
                     $("#Container").html(response);
                     $('#Container').toggle('slide', {
                         direction: 'right'
                     }, 250);
                 });
})

#container html 被响应中收到的替换,但未应用动画效果

【问题讨论】:

    标签: javascript jquery jquery-ui jquery-plugins


    【解决方案1】:

                    $('#Container').toggle('slide', {
                         direction: 'left'
                     }, 500, function () {
                         $("#Container").html('abc');
                         $('#Container').toggle('slide', {
                             direction: 'right'
                         }, 500);
                     });
      <script
      src="https://code.jquery.com/jquery-3.5.1.js"
      integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
      crossorigin="anonymous"></script>
    <script
      src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"
      integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30="
      crossorigin="anonymous"></script>
    
    <div id="Container">
    
    </div>

    看来您的脚本一切正常。我唯一想到的是包含“容器”的元素太小,所以你看不到效果。或者您可能一直在使用相邻元素的 z-index?

    【讨论】:

    • 容器元素不小。具有类 loading-overlay 的 div 实际上是一个加载器,并且肯定具有 z-index 属性,并且是容器的子元素。是不是仅仅因为 z-index 或其他原因而工作@Marek Piotrowski
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-12
    • 1970-01-01
    • 2013-04-21
    • 1970-01-01
    • 1970-01-01
    • 2012-07-07
    • 1970-01-01
    相关资源
    最近更新 更多