【问题标题】:Pace.JS Qtip how to ignore the Pace AnimationPace.JS Qtip 如何忽略 Pace Animation
【发布时间】:2020-04-07 18:57:50
【问题描述】:

我们如何在我的一个 ajax 调用中忽略带有 Pace.js 进度动画的 URL, 我遵循了文档中提到的以下内容,我试图忽略 URL 'getTip',但它仍然会触发节奏动画。

 ajax: {
     trackMethods: ['GET', 'POST'],
     trackWebSockets: false,
     ignoreURLs: ['arterySignalR', 'browserLink', 'getTip']
 }

或者我如何在以下调用中使用 Pace.ignore:

$("a[name^='qtipname']").each(function() {
    var $this = $(this);
    var id = $this.attr('rel');
    $this.qtip({
        content:{
            text: 'Loading...',
            ajax: {
                url: urlTip,
                type: 'GET', 
                loading: false,
                data: {"objectID": id}
            }
        },
        show: 'mouseover', // Show it on mouseover
        hide: {
            delay: 200,
            fixed: true // We'll let the user interact with it
        },
        style: {
            classes: 'ui-tooltip-light ui-tooltip-shadow',
            width: 290 
        }
    });
});

【问题讨论】:

  • 尝试Pace.ignoreignoreURLs中的绝对路径

标签: javascript jquery qtip


【解决方案1】:

我意识到这是一个较旧的帖子,但是我最近有这个要求,并且这个帖子是最先出现的帖子之一......我想我会把我的解决方案放在这里以防其他人需要它。

在加载 pace.min.js 库之前为 ignoreURLs 设置速度选项

<script>
    paceOptions = {
        ajax: {ignoreURLs: ['some-substring', /some-regexp/]}
    }
</script>
<script src="../dist/js/pace.min.js"></script>

我的其中一个 ignoreURL 示例:

<script>
    paceOptions = {
        ajax: {ignoreURLs: ['staffNameAutoComplete']}
    }
</script>
<script src="../dist/js/pace.min.js"></script>

“staffNameAutoComplete”是我调用的 ajax URL 的一部分。

http://www.website.com/json.php?request=staffNameAutoComplete

【讨论】:

  • 谢谢!确实需要在脚本之前设置paceOptions。您无法实时更改它
猜你喜欢
  • 1970-01-01
  • 2014-11-12
  • 2014-05-07
  • 2023-03-14
  • 1970-01-01
  • 2011-04-09
  • 1970-01-01
  • 2015-05-01
  • 2015-12-22
相关资源
最近更新 更多