0
I have 3 Ivs that show 3 products:
<div class="produtosDestaqueBoxItem">
<div class="produtosDestaqueBoxItemCentralizar">
<img src="imagens/produto1 (1).jpg" height="131" width="120" alt="" />
</div>
</div>
<div class="produtosDestaqueBoxItem">
<div class="produtosDestaqueBoxItemCentralizar">
<img src="imagens/produto1 (2).jpg" height="131" width="120" alt="" />
</div>
</div>
<div class="produtosDestaqueBoxItem">
<div class="produtosDestaqueBoxItemCentralizar">
<img src="imagens/produto1 (3).jpg" height="131" width="120" alt="" />
</div>
</div>
And a div with display:none
that appears only when you hover over the div produtosDestaqueBoxItem
.
<div style="display:none" class="produtoDestaqueBox">teste</div>
I did it with Jquery:
$(".produtosDestaqueBoxItem").hover(function () {
$(this).hide();
$('.produtoDestaqueBox').show();
});
However, this only works in the first item. You would have to use INDEX, ELEMENT?
Example:
The Divs
. produtosDestaqueBoxItem
and. produtoDestaqueBox
are sisters?– bfavaretto
I don’t quite understand what you want to do, it’s something similar to this: http://jsfiddle.net/dieegov/p97BN/ ??
– Diego Vieira
That’s right @Diegovieira
– Felipe Viero Goulart
Does this solve your problem? because you can do more than one way, without even using jquery
– Diego Vieira
Almost. At Hover, he applies the class I reported, but when he’s out, he’s back to normal
– Felipe Viero Goulart
@bfavaretto no. A div
produtosDestaqueBoxItem
has 3 equal, theprodutoDestaqueBox
appears only in the Hover– Felipe Viero Goulart
But what is the relationship between them in HTML?
– bfavaretto
Are 3 Divs
produtosDestaqueBoxItemCentralizar
. When I hover over one of them, theprodutoDestaqueBox
no longer bedisplay:none
and it getsdisplay:block
, it replaces the div. The Jquery I used worked only on the first item.– Felipe Viero Goulart
So there’s only one
produtoDestaqueBox
for the 3 products?– bfavaretto
@FelipeStoker http://jsfiddle.net/dieegov/p97BN/1/
– Diego Vieira
Basically what I’m trying to understand is whether your HTML is what’s in Jader’s answer or if it’s something else. Please always post the HTML needed for others to reproduce the problem.
– bfavaretto
@Felipestoker this is my last guess, I’m not quite sure what you want. http://jsfiddle.net/dieegov/p97BN/2/
– Diego Vieira