Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.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
jquerycarousel插件_Jquery_Jquery Plugins_Carousel - Fatal编程技术网

jquerycarousel插件

jquerycarousel插件,jquery,jquery-plugins,carousel,Jquery,Jquery Plugins,Carousel,我正在应用程序中使用Carousel jquery插件。我需要显示一个名字。它在IE中正确显示名称,但在mozilla中不正确。 这是我的密码: function mycarousel_itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) { if (document.getElementById("Id") != null) { if (item.all) { if (item.al

我正在应用程序中使用Carousel jquery插件。我需要显示一个名字。它在IE中正确显示名称,但在mozilla中不正确。 这是我的密码:

function mycarousel_itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) { 
   if (document.getElementById("Id") != null) {
      if (item.all) {
         if (item.all[1]) {
            if (item.all[1].childNodes) {
               document.getElementById("Id").innerHTML =
                     item.all[1].childNodes[0].alt;
            }
         }
      }
   }
};

有人能帮我吗。

既然您已经有了jQuery引用,为什么不直接使用它呢

function mycarousel_itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) { 
   if(jQuery('#' + idx)[0] && jQuery(item.all[1]).children()[0]){
     jQuery('#' + idx).html( jQuery(jQuery(item.all[1]).children()[0]).attr('alt'));
   }
};

你能提供更多的信息吗?您的实现的一个代码示例很好。函数mycarousel_itemVisibleInCallbackAfterAnimation(carousel,item,idx,state){debugger if(document.getElementById(“Id”)!=null){if(item.all){if(item.all)[1]){if(item.all[1].childNodes){document.getElementById(“Id”).innerHTML=item.all[1].childNodes[0].alt;};这是我正在使用的代码。在IE中,它正确地获取值,但在mozilla中,它不显示名称。item.all未定义。你能帮我解决这个问题吗?你应该为此编辑你的问题并在那里发布代码。这更容易理解。@Rob,你能告诉我关于这个问题的答案吗。