Click here to Skip to main content
14,980,591 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to apply multiple background image in image hover effect in java script.

What I have tried:

how to apply multiple background image in image hover effect in java script.
Posted
Updated 23-Jun-19 20:03pm
Comments
F-ES Sitecore 24-Jun-19 4:14am
   
You can't, you can only have one background image at a time. You'll need to explain your requirement in more detail.
Richard Deeming 25-Jul-19 8:00am
   

1 solution

you can try this, by adding multiple img tag for an each style block to them

<!DOCTYPE html>
<html>
<head>
<style>

figure img {
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition: .3s ease-in-out;
  transition: .3s ease-in-out;
}
figure:hover img {
  -webkit-transform: scale(1.3);
  transform: scale(1.3);
}

figure1 img {
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition: .3s ease-in-out;
  transition: .3s ease-in-out;
}
figure1:hover img {
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}

figure2 img {
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition: .3s ease-in-out;
  transition: .3s ease-in-out;
}
figure2:hover img {
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}

figure3 img {
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition: .3s ease-in-out;
  transition: .3s ease-in-out;
}
figure3:hover img {
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}

figure4 img {
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition: .3s ease-in-out;
  transition: .3s ease-in-out;
}
figure4:hover img {
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}

figure5 img {
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition: .3s ease-in-out;
  transition: .3s ease-in-out;
}
figure5:hover img {
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}

figure6 img {
  -webkit-transform: scale(1);
  transform: scale(1);
  -webkit-transition: .3s ease-in-out;
  transition: .3s ease-in-out;
}
figure6:hover img {
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}
</style>
</head>
<body>
<div>

<figure>
 
</figure>

<figure1>
  <img src="sa.jpg" />  
</figure1>

<figure2>
  <img src="sa.jpg" />  
</figure2>

<figure3>
  <img src="sa.jpg" />  
</figure3>

<figure4>
  <img src="sa.jpg" />  
</figure4>

<figure5>
  <img src="sa.jpg" />  
</figure5>

<figure6>
  <img src="sa.jpg" />  
</figure6>


</div>
</body>
</html>
   
Comments
Shraddha_Patel 16-Sep-19 1:09am
   
Thank you for suggestion...it's useful for me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900