I am trying to create a zoom effect on a background image without affecting the text overlaying it.
Here is the CSS code:
.page1-box {
width: 1200px;
height:800px;
overflow:hidden;
}
.page1 {
width: 100%;
height: 100%;
background: url('../images/home_page.jpg');
background-position:center center;
background-size:cover;
transform:scale(1);
transition:all 5s ease-in;
}
.page1.zout {
transform:scale(1.2);
}
And here is the JavaScript code:
setTimeout(function () {
$('.pag1').addClass('zout');
}, 100);
Finally, this is the HTML Code:
<section class="page1">
<div class="page_container">
<div class="text">
sample text here
</div>
</div>
</section>
Currently, when I run this code, both the background image and the text get transformed. Is there a way to isolate the zoom effect only to the background image?
Any help would be appreciated.