jquery - maintain image position while scaling video -
i have few see-through click elements on video.. when changing aspect ratio of browser positioning of elements messes causes click action not happen when click on animation.
i use % reason still doesn't position correctly on multiple screen sizes.
css:
#vidklik1{ width: 8%; height: 30%; top: 148%; left: 16%; }
html:
<div class="popup"> <video preload="auto" autoplay="autoplay" loop="loop" id="background2"> <source src="background/background2.mp4" type="video/mp4"> </source> <source src="background/background2.ogv" type="video/ogg"> </source> <source src="background/background2.webm" type="video/webm"> </source> </video> <a href="#popup-box" class="popup-window"> <img src="images/klik.jpg" id="vidklik1"> </a> <a href="#popup-box" class="popup-window"> <img src="images/klik.jpg" id="vidklik2"> </a> <a href="#popup-box" class="popup-window"> <img src="images/klik.jpg" id="vidklik3"> </a> <a href="#popup-box" class="popup-window"> <img src="images/klik.jpg" id="vidklik4"> </a> </div>
and reason have use top: 148% because if take top: 100% positions 50% top of page, right in between 2 video's
is there way fix this? i'am using % reason won't position image correctly.. i've tried using vh , vw, don't know other things make image appear on position when video behind scales.
in short: have image want scale video behind make video have clickable interactions, goes far down.
to follow on comments, here's working fiddle
css
.popup { position:relative; width:75%; } .popup video { width:100%;} .popup { position:absolute; z-index:1000;} #vidklik1 { top:5%; left:5%; }
html
<div class="popup"> <video preload="auto" autoplay="autoplay" loop="loop" id="background2"> <source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4"></source> <source src="http://vjs.zencdn.net/v/oceans.webm"></source> </video> <a href="#popup-box" class="popup-window" id="vidklik1"> <img src="http://placehold.it/50x50" /> </a> </div>
the important parts
popup
needsposition:relative
- the
<a>
needs have id can position independently of others
Comments
Post a Comment