javascript - How to achieve a zooming effect on a carousel background using CSS3 and JQuery -
i want add background zooming out effect same in this website carousel.. cannot figure out solution new web-designing.
this code div want apply effect:
markup:
<div class="banner"> <div class="content block1 animated"> <h1>ceramic directory</h1> <span>world's largest ceramic hub, ceramic traders reside here!</span> <a href="#">register now</a> <span class="handler">→</span> </div> </div>
css:
.banner{ margin-bottom: 10px; background-image: url("../images/png.jpg"); background-repeat: no-repeat; height: 700px; background-size: cover; width: 100%; } .banner .block1{ background-color: rgba(256,256,256,0.7); margin-top: 10%; height: 300px; position: absolute; width: 90%; padding-top: 7%; animation-name: fadein; -webkit-animation-name: fadein; } .banner .block1 h1{ text-align: center; font-family: latoweblight; font-size: 40px; margin-bottom: 5px; } .banner .block1 span{ text-align: center; font-family: latowebhairline; font-size: 25px; margin-bottom: 30px; display: block; } .banner .block1 a{ text-align: center; border-radius: 5px; border: 1px solid black; font-family: latowebmedium; font-size: 18px; margin-left: 45%; margin-top: 5%; padding: 10px; text-decoration: none; color: black; } .banner .block1 .handler{ text-align: center; border-radius: 5px; border: 1px solid black; cursor: pointer; font-size: 18px; margin-left: 105%; margin-top: -5%; padding: 10px; color: black; width: 20px; transition: color 0.2s; -webkit-transition: color 0.2s; transition: background 0.2s; -webkit-transition: background 0.2s; } .banner .block1 .handler:hover{ font-weight: 900; background: rgba(34,34,34,0.5); color: white; }
how did make that?
thanks help
the website mentioned uses jquery plugin animate header image. can find plugin's page here , detailed documentation here
if don't plan on using plugin, can achieve image scalling effect using css3. same example below:
.test { width: 300px; height: 300px; position: relative; left: 30px; top: 30px; transition: 1s; } .test:hover { -webkit-transform: scale(1.05, 1.05); transform: scale(1.05, 1.05); } .test:after { content: ''; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; background: url("http://lorempixel.com/600/400"); background-size: cover; }
<div class="test"> </div>
Comments
Post a Comment