html - Hover Share Button Over Every Image -
i using embedded quiz platform, see https://output.jsbin.com/pabopusulo.
i want make every image hover "share button" centered in middle.
facebook share code:
<div class="fb-share-button" data-layout="box_count"></div>
i tried doing using css calling div display:block;
did not work. not sure if possible. please keep in mind, new coding.
thanks all.
update: embedded script:
<script type="text/javascript" src="//cdn.playbuzz.com/widget/feed.js"></script> <div class="pb_feed" data-embed-by="6c7dc1a3-ea2c-490e-8b3f-8526cdf5bcb4" data-game="/drishtib10/what-is-your-personality-type-according-to-your-perception" data-recommend="false" data-game-info="false" data-comments="false" data-shares="false" ></div>
do mean this?
note: can't see result here because of security reason, created bin this.
.wrapper { position:relative; display:inline-block; } .wrapper:before { content:""; position:absolute; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); opacity:0; transition: .3s ease; } .fb-share-button.fb_iframe_widget { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0; z-index:1; transition:all .3s ease; } .wrapper:hover .fb-share-button.fb_iframe_widget, .wrapper:hover:before { opacity:1; }
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js#xfbml=1&version=v2.5&appid=850697865046018"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="wrapper"> <img src="https://pixabay.com/static/uploads/photo/2016/03/06/16/51/balance-1240737__180.jpg" /> <div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count"></div> </div>
Comments
Post a Comment