CSS
- 9 ответов
- 0 вопросов
3
Вклад в тег
<script>
<script>
$(document).ready(function() {
$('.article').click(function(){
var articleView = $(this).parent('.Node').find('.article');
var viewArticle = $(this).parent('.Node').find('.articleBlock');
var url = $(this).attr('data');
$.getJSON(url, function(data){
$.each(data, function(i, field){
var productCount = viewArticle.append('<div class="articleBlocPrice">'+field.price+' руб.</div><div class="articleBlockDote"></div><div class="articleBlockName">'+field.name+'</div><div style="clear:both"></div>');
if ( articleView.attr("data") == productCount ) {
articleView.removeAttr("data")
} else {
articleView.attr("data", productCount);
}
});
});
});
});
</script>