Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/449.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery模式和FancySelect插件_Javascript_Jquery_Modal Dialog - Fatal编程技术网

Javascript jQuery模式和FancySelect插件

Javascript jQuery模式和FancySelect插件,javascript,jquery,modal-dialog,Javascript,Jquery,Modal Dialog,我已经安装了jQuery FancySelect插件。很好。现在我尝试在模式弹出窗口中调用它,但它不起作用。这是父窗口中的代码: <script src="/js/fancySelect.js" type="text/javascript"></script> <script> $(document).ready(function() { $('.fancyselect').fancySelect(); var repoName = 'f

我已经安装了jQuery FancySelect插件。很好。现在我尝试在模式弹出窗口中调用它,但它不起作用。这是父窗口中的代码:

<script src="/js/fancySelect.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
    $('.fancyselect').fancySelect();
    var repoName    = 'fancyselect'
    var menu        = $('#top').find('menu');
    function positionMenuArrow() {
        var current = menu.find('.current');
        menu.find('.arrow').css('left', current.offset().left + (current.outerWidth() / 2));
    }
    $(window).on('resize', positionMenuArrow);
    menu.on('click', 'a', function(e) {
        var el          = $(this),
        href            = el.attr('href'),
        currentSection  = $('#main').find('.current');
        e.preventDefault();
        menu.find('.current').removeClass('current');
        el.addClass('current');
        positionMenuArrow();
        if (currentSection.length) {
            currentSection.fadeOut(300).promise().done(function() {
                $(href).addClass('current').fadeIn(300);
            });
        }
        else {
            $(href).addClass('current').fadeIn(300);
        }
    });
    menu.find('a:first').trigger('click')
});
</script>

将class=fancyselect添加到父工程中的任何选择。但是,如果添加到模式弹出选择中,则不起作用。

这里只是推测一下,因为您没有显示处理弹出创建的HTML或JS逻辑。调用时,是否希望从页面上已存在的弹出插件中应用FancySelect方法的元素:

$('.fancyselect').fancySelect();
?

如果元素是在页面加载之后添加的,那么该语句将不会提取这些元素。当显示弹出窗口时,您将执行以下操作

$('#popupcontainer .fancyselect').fancySelect();
因此,所有必需的代码也将应用于这些元素

更新:

在原始帖子中更新后,您可以添加如下内容:[未测试]

onLoad: function() { 
    var wrap = this.getOverlay().find(".contentWrap"); 
    $(wrap).find('.fancyselect').fancySelect();         
}    

这应该在填充弹出窗口后触发。

模式是使用以下内联JS的覆盖:$function{$a[rel]。覆盖{mask:'EAEAEA',effect:'apple',api:true,onBeforeLoad:function{var wrap=this.getOverlay.find.contentWrap;wrap.loadthis.getTrigger.attrref;}}};};这在页眉中FancySelect代码之后的页脚中。