Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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
Fancyapps(fancybox)在(';单击';)触发器上终止jQuery_Jquery_Fancybox 2 - Fatal编程技术网

Fancyapps(fancybox)在(';单击';)触发器上终止jQuery

Fancyapps(fancybox)在(';单击';)触发器上终止jQuery,jquery,fancybox-2,Jquery,Fancybox 2,我在这个网站上解决了很多问题和解决方案,但没有一个适合我 软件: jqueryv1.7.2 fancybox v2.0.6 我有一个隐藏的div,里面有另一个div,我正在使用jQuery插件文件树显示一个文件管理器。当点击浏览图标时,这将100%起作用 我现在试图在单击浏览图标时在fancybox中显示filemanager div。这只是第一次起作用。打开(“单击”)功能不会记录此后的任何单击 但是,如果我删除fancybox块中的“href:myID”行,它每次都会工作。因此,fancyb

我在这个网站上解决了很多问题和解决方案,但没有一个适合我

软件: jqueryv1.7.2 fancybox v2.0.6

我有一个隐藏的div,里面有另一个div,我正在使用jQuery插件文件树显示一个文件管理器。当点击浏览图标时,这将100%起作用

我现在试图在单击浏览图标时在fancybox中显示filemanager div。这只是第一次起作用。打开(“单击”)功能不会记录此后的任何单击

但是,如果我删除fancybox块中的“href:myID”行,它每次都会工作。因此,fancybox href函数中的某些内容正在终止on('click')触发器

我将其追溯到myID的DOM声明,然后仅当单击的浏览图标位于同一父结构中时

任何想法都会受到欢迎,因为我已经花了相当多的时间来找出错误

HTML:

<div>
    <div>
        <input field where the value will go />
    </div>
    <div>
      <img class='browse' src='images/browse.gif' title='' alt=''/>
   </div>
   <div class='hidden'>
      <div id='FM_defaultAdminUploadRootDir' class='filemanager'></div>
   </div>
</div>
jQuery(document).ready(function() {
   jQuery.noConflict();

   var myID;
   var myRoot = '{$site_Root}';
   var myDir;

   jQuery('.browse').on('click', function(){

      myID = '#'+this.parentElement.parentElement.children[2].firstElementChild.id;

        jQuery(myID).fileTree({
           root: myRoot,
           script: '".PURPLE_WYSIWYG_SRC_ABS_PATH."jqueryFileTree/connectors/jqueryFileTree.php',
           folderEvent: 'click',
           multiFolder: false,
           expandEasing : 'easeOutExpo',
           collapseEasing : 'easeInExpo'
        },
        function(file) {
            //alert(file);
        },
        function(dire) {
            myDir = dire;
        }
      );

      jQuery.fancybox({
          href: myID,  // <----- REMOVE THIS AND IT WORKS
          title: 'Select the directory',
          helpers : {
              title: {
                  type: 'outside'
              },
              overlay : {
                 opacity: 0.7,
                 css : {
                     'background-color' : '#433'
                 }
              }
          }
    });
    return false;
});

jQuery:

<div>
    <div>
        <input field where the value will go />
    </div>
    <div>
      <img class='browse' src='images/browse.gif' title='' alt=''/>
   </div>
   <div class='hidden'>
      <div id='FM_defaultAdminUploadRootDir' class='filemanager'></div>
   </div>
</div>
jQuery(document).ready(function() {
   jQuery.noConflict();

   var myID;
   var myRoot = '{$site_Root}';
   var myDir;

   jQuery('.browse').on('click', function(){

      myID = '#'+this.parentElement.parentElement.children[2].firstElementChild.id;

        jQuery(myID).fileTree({
           root: myRoot,
           script: '".PURPLE_WYSIWYG_SRC_ABS_PATH."jqueryFileTree/connectors/jqueryFileTree.php',
           folderEvent: 'click',
           multiFolder: false,
           expandEasing : 'easeOutExpo',
           collapseEasing : 'easeInExpo'
        },
        function(file) {
            //alert(file);
        },
        function(dire) {
            myDir = dire;
        }
      );

      jQuery.fancybox({
          href: myID,  // <----- REMOVE THIS AND IT WORKS
          title: 'Select the directory',
          helpers : {
              title: {
                  type: 'outside'
              },
              overlay : {
                 opacity: 0.7,
                 css : {
                     'background-color' : '#433'
                 }
              }
          }
    });
    return false;
});
jQuery(文档).ready(函数(){
jQuery.noConflict();
粘虫变种;
var myRoot='{$site_Root}';
var-myDir;
jQuery('.browse')。在('click',function()上{
myID='#'+this.parentElement.parentElement.children[2].firstElementChild.id;
jQuery(myID).fileTree({
根:我的根,
脚本:“.PURPLE\u WYSIWYG\u SRC\u ABS\u PATH.”jqueryFileTree/connectors/jqueryFileTree.php“,
folderEvent:'单击',
多重文件夹:错误,
expandEasing:“easeOutExpo”,
折叠显示:“easeinfeo”
},
函数(文件){
//警报(文件);
},
功能(dire){
myDir=可怕;
}
);
jQuery.fancybox({

href:myID,//什么是
myID='#'+this.parentElement.parentElement.children[2].firstElementChild.id;
return?抱歉,我发现我没有在问题的HTML代码部分添加所选值所在的输入字段div。它返回正确的id“#FM#u defaultAdminUploadRootDir”。我发现了这一点-这正是发生的情况。DOM元素被留在正文的底部。它不会被插入回其原始位置。因此,在myID='#'+this.parentElement.parentElement.children[2]行中生成DOM链声明.firstElementChild.id;无法dind该元素,因为它不再存在于相对位置中-它现在位于正文的底部。那么使用
内容:myID,键入:“inline”
选项而不是
href:myID
选项如何?我已经尝试过了。它没有任何用处,因为DOM链不会将div作为FancyBox找到已将其移动到正文底部,但在显示后未将其返回到原始位置。据我所知,Github线程不会修复/解决此问题,因为它并不重要。