JQuery Карусель Плагин - PullRequest
       12

JQuery Карусель Плагин

0 голосов
/ 26 мая 2011

Я использую плагин Карусель 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;
            }
         }
      }
   }
};

Может ли кто-нибудь мне помочь.

1 Ответ

0 голосов
/ 10 июня 2011

Поскольку у вас уже есть ссылка на 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'));
   }
};
...