Добрый день, Всем! У меня возникла проблема: хочу сделать jcaousel, но она уперто отказывается работать и не выводит новые классы. Помогите пожалуйста.
Оборачивающий дивы я заменил на li и ul в views-slideshow-pager-field-item.tpl.php и views-slideshow-pager-fields.tpl.php соответственно и упростил views-slideshow-pager-field-field.tpl.php. Код чистый можете посмотретьна скриншоте. В Sate.info раскоментировал script.js и добавил строку jquery.jcarousel.min.js. Скопировал последний в папку js.
В script.js использовал код:
(function ($, Drupal, window, document, undefined) {
Drupal.behaviors.my_custom_behavior = {
attach: function(context, settings) {
$(document).ready(function(){
$('#widget_pager_bottom_global_product-block').jcarousel();
});
}
};
})(jQuery, Drupal, this, this.document);
Не понимаю что я сделал не так. Помогите пожалуйста.
Вложение | Размер |
---|---|
![]() | 46.94 КБ |
Комментарии
Прочтите readme - там написано как выводить карусель с custom class, и не надо hardcore.
...
An alternative to using jcarousel_add() is passing a list of items that will be
in your carousel into theme('jcarousel'). This can be useful to not only add
the necessary JavaScript and CSS to the page but also to print out the HTML
list.
print theme('jcarousel', array('items' => $items, 'options' => $options, 'identifier' => $identifier));
...
see also, - jcarousel.module
...
function theme_jcarousel($variables) {
...
Я не так силен в программировании и боюсь не до конца понял или вообще понял ничего верно.
Строку:
" print theme('jcarousel', array('items' => $items, 'options' => $options, 'identifier' => $identifier)); "
нужно вставить в script.js или в файл *.tpl.php где у меня хранится вью?
Чтобы не кодить, юзаем https://drupal.org/project/flexslider