Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Orlanov

Newbie
  
  • Posts

    2
  • Joined

  • Last visited

Orlanov's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. JQuery в помощь, в сети полно слайдшоу решений.
  2. Здравствуйте, помогите разобраться с куском javascript кода в файле ../../template/product/category.tpl Предназначен он для замены стилей (насколько я понял) когда выбираем вид отображения(сетка/витрина) каталога с товарами. Вот сам код: function display(view) { if (view == 'list') { $('.product-grid').attr('class', 'product-list'); $('.product-list > div').each(function(index, element) { html = '<div class="right">'; html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>'; html += ' <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>'; html += ' <div class="compare">' + $(element).find('.compare').html() + '</div>'; html += '</div>'; html += '<div class="left">'; var image = $(element).find('.image').html(); if (image != null) { html += '<div class="image">' + image + '</div>'; } var price = $(element).find('.price').html(); if (price != null) { html += '<div class="price">' + price + '</div>'; } html += ' <div class="name">' + $(element).find('.name').html() + '</div>'; html += ' <div class="description">' + $(element).find('.description').html() + '</div>'; var rating = $(element).find('.rating').html(); if (rating != null) { html += '<div class="rating">' + rating + '</div>'; } html += '</div>'; $(element).html(html); }); $('.display').html('<b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display(\'grid\');"><?php echo $text_grid; ?></a>'); $.cookie('display', 'list'); } else { $('.product-list').attr('class', 'product-grid'); $('.product-grid > div').each(function(index, element) { html = ''; var image = $(element).find('.image').html(); if (image != null) { html += '<div class="image">' + image + '</div>'; } html += '<div class="name">' + $(element).find('.name').html() + '</div>'; html += '<div class="description">' + $(element).find('.description').html() + '</div>'; var price = $(element).find('.price').html(); if (price != null) { html += '<div class="price">' + price + '</div>'; } var rating = $(element).find('.rating').html(); if (rating != null) { html += '<div class="rating">' + rating + '</div>'; } html += '<div class="cart">' + $(element).find('.cart').html() + '</div>'; html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>'; html += '<div class="compare">' + $(element).find('.compare').html() + '</div>'; $(element).html(html); }); $('.display').html('<b><?php echo $text_display; ?></b> <a onclick="display(\'list\');"><?php echo $text_list; ?></a> <b>/</b> <?php echo $text_grid; ?>'); $.cookie('display', 'grid'); } } view = $.cookie('display'); if (view) { display(view); } else { display('list'); } //--></script> Если возможно прокаментируйте в коде основные моменты.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.