<!doctype html>
<html>
<head>
<title>CSS Hover</title>
<link rel="stylesheet" href="hover.css">
</head>
<body>
<div class="container">
<span class="color-black">Black</span>
<span class="color-red">Red</span>
<span class="color-green">Green</span>
<div class="image"></div>
</div>
</body>
</html>
div.image {
width: 100px;
height: 75px;
}
span.color-black:hover ~ div.image {
background-image: url(black.png);
}
span.color-red:hover ~ div.image {
background-image: url(red.png);
}
span.color-green:hover ~ div.image {
background-image: url(green.png);
}
function addTovar (val){
// добавляет товар
// alert(val.image)
var block = $('#tovar_block');
block.append('' +
'<li class="catalog-elements-ul-li parent">' +
' <div class="catalog-elements-ul-li-photo">' +
' <a href="#" class="nailthumb-container">' +
' <img src="/img/product/smal/'+val.art+'_0.jpg.jpg">' +
' </a>' +
' <div class="tovar-sravni">' +
' <input type="checkbox" name="check">' +
' </div>' +
' </div>' +
' <div class="catalog-elements-ul-li-name">' +
' <a href="#" class="catalog-elements-ul-li-name-link">'+val.name+'</a>' +
' <span class="catalog-elements-ul-li-name-text">'+val.title+'</span>' +
' <div class="catalog-elements-ul-li-name-el">' +
' <a href=""><strong>Отзывы</strong> <span>4</span></a>' +
' <a href=""><strong>Описание</strong></a>' +
' <a href=""><strong>Фото</strong></a>' +
' </div>' +
' </div>' +
' <div class="catalog-elements-ul-li-add">' +
' <span class="tovar-list-price">'+val.price+' <span>₷</span></span>' +
' <div class="tovar-star parent">' +
' <span class="star-on"></span>' +
' <span class="star-on"></span>' +
' <span class="star-on"></span>' +
' <span class="star-on"></span>' +
' <span class="star-on"></span>' +
' </div>' +
' <span class="code-tovar">Код товара: '+val.art+'</span>' +
' <button id="catalog-add">В корзину<span></span></button>' +
' </div>' +
'</li>');
jQuery('.nailthumb-container').nailthumb({method:'resize',fitDirection:' center'});
}