Jump to content
  • 0

нужно помощь по скрипту галереи


itspider
 Share

Question

Прошу помощи, т.к. далек от js.

Есть html код


<div class="box">
<div class="box-heading">Состав коллекции</div>
<div class="box-content">
<div class="box-product related">

<ul class="portfolio-categ filter">
<li>Категории:</li>
<li class="all active"><a href="#">Все</a></li>
<li class="cat-item-1"><a href="#" title="Category 1">Категория 1</a></li>
<li class="cat-item-2"><a href="#" title="Category 2">Категория 2</a></li>
<li class="cat-item-3"><a href="#" title="Category 3">Категория 3</a></li>
<li class="cat-item-4"><a href="#" title="Category 4">Категория 4</a></li>
</ul>
<ul class="portfolio-area">
<li class="portfolio-item2" data-id="id-1" data-type="cat-item-2">
<div>
<div class="image"><a href="#"><img src="image/product/burgund-250.jpg" alt="" title="Название" /></a></div>
<div class="name"><a href="#">Название</a></div>
<div class="price">a120.68</div>
<div class="abs">
<div class="cart"> <a class="button1" title="В корзину"><span>В корзину</span></a> <a class="btn-detail ml10" title="Подробно" href="#"><span>Подробно</span></a></div>
</div>
</div>
</li>
<li class="portfolio-item2" data-id="id-2" data-type="cat-item-1">
<div>
<div class="image"><a href="#"><img src="image/plitka/1.jpg" alt="" title="Название" /></a></div>
<div class="name"><a href="#">Название</a></div>
<div class="price">a120.68</div>
<div class="abs">
<div class="cart"> <a class="button1" title="В корзину"><span>В корзину</span></a> <a class="btn-detail ml10" title="Подробно" href="#"><span>Подробно</span></a></div>
</div>
</div>
</li>
<li class="portfolio-item2" data-id="id-3" data-type="cat-item-3">
<div>
<div class="image"><a href="#"><img src="image/product/burgund-250.jpg" alt="" title="Название" /></a></div>
<div class="name"><a href="#">Название</a></div>
<div class="price">a120.68</div>
<div class="abs">
<div class="cart"> <a class="button1" title="В корзину"><span>В корзину</span></a> <a class="btn-detail ml10" title="Подробно" href="#"><span>Подробно</span></a></div>
</div>
</div>
</li>
<li class="portfolio-item2" data-id="id-4" data-type="cat-item-1">
<div>
<div class="image"><a href="#"><img src="image/plitka/4.jpg" alt="" title="Название" /></a></div>
<div class="name"><a href="#">Название</a></div>
<div class="price">a120.68</div>
<div class="abs">
<div class="cart"> <a class="button1" title="В корзину"><span>В корзину</span></a> <a class="btn-detail ml10" title="Подробно" href="#"><span>Подробно</span></a></div>
</div>
</div>
</li>
<li class="portfolio-item2" data-id="id-5" data-type="cat-item-4">
<div>
<div class="image"><a href="#"><img src="image/product/burgund-250.jpg" alt="" title="Название" /></a></div>
<div class="name"><a href="#">Название</a></div>
<div class="price">a120.68</div>
<div class="abs">
<div class="cart"> <a class="button1" title="В корзину"><span>В корзину</span></a> <a class="btn-detail ml10" title="Подробно" href="#"><span>Подробно</span></a></div>
</div>
</div>
</li>
</ul>

</div>
</div>
</div>

и js, через библиотеку Quicksand


jQuery(document).ready(function($)
{
if(jQuery().quicksand)
{[/b]
[b] // Выбираем все дочерние элементы portfolio-area и записываем в переменную
var $data = $(".portfolio-area").clone();[/b]
[b] $('.portfolio-categ li').click(function(e)
{
$(".filter li").removeClass("active");[/b]
[b] var filterClass = $(this).attr('class').split(' ').slice(-1)[0];[/b]
[b] if(filterClass == 'all')
{
var $filteredData = $data.find('.portfolio-item2');
} else
{
var $filteredData = $data.find('.portfolio-item2[data-type=' + filterClass + ']');
}
$(".portfolio-area").quicksand($filteredData, {
duration: 600,
adjustHeight: 'auto'
}, function()
{[/b]
[b] lightboxPhoto();
});
$(this).addClass("active");
return false;
});[/b]
[b] } //if quicksand[/b]
[b]});

не могу их подружить

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy