6
$(".img1").mouseenter(function() {
$(this).css('box-shadow', "inset 0 0 20px black");
});
$(".img1").mouseout(function(){
$(this).css('box-shadow', "");
});
$(".img2").mouseenter(function() {
$(this).css('box-shadow', "inset 0 0 20px black");
});
$(".img2").mouseout(function(){
$(this).css('box-shadow', "");
});
$(".h2").mouseenter(function(){
$('.img2').css("box-shadow","inset 0 0 20px black");
});
$(".h2").mouseout(function(){
$('.img2').css("box-shadow", '');
});
$(".h1").mouseenter(function(){
$('.img1').css("box-shadow","inset 0 0 20px black");
});
HTML
<div class="box first">
<div >
<img class="img1" />
</div>
<a href="t1.html"><h3 class="h1"> Aliens </h3></a>
<div>
<p></p>
</div>
</div>
<div class="box second">
<div>
<img class="img2" />
</div>
<a href="a2.html"><h3 class="h2"> Day of the Dead </h3></a>
<p></p>
</div>
<div class="box third">
<div>
<img class="img3" />
</div>
<a href="a3.html"><h3 class="h3"> Evil dead </h3></a>
<p></p>
</div>
How do I make this code shorter to give for more images without always repeating the same. http://omeufilme.esy.es/teste2.html Here’s my site, there’s that white border around the images, how do I get it out?
Can you show the structure of your HTML? I’m happy to answer but can’t help much without seeing the HTML and understanding the default/ architecture of the code.
– Sergio
The term "compress" was not adequate. The right one would be "reduce redundancies", "eliminate redundancies". The term "compress" gives an idea of compressing, or minifying the code, which is very different.
– Daniel Omine
I repeat that the lack of HTML creates answers to "guess" the problem. The ideal would be to put the HTML for more correct answers that optimize the code.
– Sergio
in the next doubt I will take this into account, thanks for the tip.
– João Pedro
@Peter could have gathered here any way. The question remains incomplete for all the others who for years have seen this question... I will put it together in a little while and in return I will give an answer too.
– Sergio
http://answall.com/questions/101823/aparecimento-de-border-n%C3%A3o-relatada here a new topic I opened, is the continuation where I was able to solve this problem but another appeared.
– João Pedro
@Joãopedro added a new answer here although you already have another accepted. To answer in the other you have to explain the problem better. With an image of the behavior you refer to or an example in jsFiddle with images and the problem appearing. This way the help is more accurate and fast. "win win"
– Sergio