Jquery 隐藏的Wordpress模式

Jquery 隐藏的Wordpress模式,jquery,wordpress,modal-dialog,Jquery,Wordpress,Modal Dialog,我有一个真正的问题与wordpress网站和以下代码。它的工作,除了我似乎无法得到的Z-索引更新。我尝试过为ui front和几乎所有其他标签添加和编辑CSS。如果我在Chrome中打开inspector,我看到它仍然会自动为叠加指定100的Z索引,为模式指定101的Z索引。如果我在Inspector中手动将其调整为5k,则模态将在所有对象的前面弹出。我似乎无法理解如何将z-index强制到我想要的内容[以及我的Wordpress主题和我在css中搜索到的所有内容],但没有看到任何其他z-ind

我有一个真正的问题与wordpress网站和以下代码。它的工作,除了我似乎无法得到的Z-索引更新。我尝试过为ui front和几乎所有其他标签添加和编辑CSS。如果我在Chrome中打开inspector,我看到它仍然会自动为叠加指定100的Z索引,为模式指定101的Z索引。如果我在Inspector中手动将其调整为5k,则模态将在所有对象的前面弹出。我似乎无法理解如何将z-index强制到我想要的内容[以及我的Wordpress主题和我在css中搜索到的所有内容],但没有看到任何其他z-index声明,因此不知道为什么自动赋值不起作用。请帮助

add_action( 'wp_enqueue_scripts', 'enqueue_scripts_so_22382151' );
add_action( 'wp_header', 'print_header_so_22382151' );
add_action( 'wp_footer', 'print_footer_so_22382151' );

/**
 * Enqueue jQuery Dialog and its dependencies
 * Enqueue jQuery UI theme from Google CDN
 */
function enqueue_scripts_so_22382151() {
    wp_enqueue_script( 'jquery-ui-dialog', false, array('jquery-ui','jquery') );
    wp_enqueue_style( 'jquery-ui-cdn', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/dot-luv/jquery-ui.min.css' );
}    


/**
 * Print Dialog custom style
 */
function print_header_so_22382151() { 
    ?>
    <style>
        /* A class used by the jQuery UI CSS framework for their dialogs. */
        .ui-front {
            z-index:1000000 !important; /* The default is 100. !important overrides the default. */
        }
        .ui-widget-overlay {
            opacity: .8;
        }
    </style>
    <?php
}

/**
 * Print Dialog script
 */
function print_footer_so_22382151() { 
    $current_domain = $_SERVER['SERVER_NAME'];
    ?>
    <script type="text/javascript">
        jQuery(document).ready(function ($) {
          $('a[href^="http://"],a[href^="https://"]')
            .not('[href*="<?php echo $current_domain; ?>"]')
            .click(function(e) {
                e.preventDefault();
                var url = this.href;
                $('<div></div>').appendTo('body')
                    .html('<div><h6>Link Disclaimer:  [...].</h6></div>')
                    .dialog({
                        modal: true, title: 'message', zIndex: 10000, autoOpen: true, width: 'auto', resizable: false,
                        buttons: {
                            Yes: function () {
                                window.open(url);
                                $(this).dialog("close");
                            },
                            No: function () {
                                $(this).dialog("close");
                            }
                        },
                        close: function (event, ui) {
                            $(this).remove();
                        }
                    });
              })
        });
    </script>
    <?php 
}
add_action('wp_enqueue_scripts'、'enqueue_scripts_so_22382151');
添加“操作”(“wp\u头”,“打印\u头\u so\u 22382151”);
添加“操作('wp\u footer','print\u footer\u so\u 22382151”);
/**
*将jQuery对话框及其依赖项排队
*从Google CDN将jQuery UI主题排队
*/
函数排队\u脚本\u so \u 22382151(){
wp_enqueue_脚本('jqueryui对话框',false,数组('jquery-ui','jquery');
wp_排队_样式('jqueryuicdn','http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/dot-luv/jquery-ui.min.css' );
}    
/**
*打印对话框自定义样式
*/
函数print_header_so_22382151(){
?>
/*jQueryUICSS框架用于对话框的类*/
.ui前端{
z-index:1000000!重要;/*默认值为100。!重要值覆盖默认值*/
}
.ui小部件覆盖{
不透明度:.8;
}
jQuery(文档).ready(函数($){
$('a[href^=“http://]”,a[href^=“https://]”)
.not(“[href*=”“]”)
。单击(功能(e){
e、 预防默认值();
var url=this.href;
$('').appendTo('正文')
.html('链接免责声明:[……]”)
.对话({
模态:true,标题:“消息”,zIndex:10000,自动打开:true,宽度:“自动”,可调整大小:false,
按钮:{
是:函数(){
窗口打开(url);
$(此).dialog(“关闭”);
},
否:函数(){
$(此).dialog(“关闭”);
}
},
关闭:功能(事件、用户界面){
$(this.remove();
}
});
})
});

好的,我回答了我自己的问题。哈哈,我没有留下CSS Jquery声明,而是将它们移出并粘贴在wordpress主题的样式表CSS的尾部[Stylesheet.CSS默认情况下]。现在z索引设置得很好。

将CSS放在style.CSS而不是函数文件中。