【问题标题】:jQuery conflicts in wordpresswordpress 中的 jQuery 冲突
【发布时间】:2012-07-17 00:27:42
【问题描述】:

我正在使用这个插件:http://wordpress.org/extend/plugins/wpmbytplayer/ 但是,当我运行以下 jQuery 来为标题中的框设置动画时,背景视频会停止并冻结。有谁知道为什么?

jQuery(function($) {
    jQuery('#open').click(function(){
        jQuery('#pull_down_content').animate({'top':'-25px'},1000);
        jQuery('#open').fadeTo('slow', 0);
    });
    jQuery('#close').click(function(){
        jQuery('#pull_down_content').animate({'top':'-800px'},1000);
        jQuery('#open').fadeTo('slow', 1);
    });
});

【问题讨论】:

  • $ 传递到您的函数中的想法是您不必必须使用冗长的jQuery

标签: jquery jquery-plugins wordpress


【解决方案1】:

另一个提示是不要使用 #open 两次,您可以使用它来引用同一个对象。含义:

$('#open').click(function(){

    $('#pull_down_content').animate({'top':'-25px'},1000);
    $(this).fadeTo('slow', 0);

});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-05
    • 2012-11-14
    • 1970-01-01
    相关资源
    最近更新 更多