javascript - figure caption on hover center text -


in fiddle http://jsfiddle.net/sldhsbou/ have "x" appears when hovering absolutely centered no matter size of image is.

in addition why there no transition when mouse moves outside figure there when mouse moves in?

<table border=1 style="width: 100%;">     <tr><td colspan=6 style="border-bottom: medium solid gray;">&nbsp;</td></tr>     <tr>         <td class="left" style="width: 25%; background-color: cyan;">             <table border=2 style="width: 100%;">                 <tr>                     <td style="border: thin solid #ff9900;">                         <div class="img-wrap">                             <figure class="cap-bottom">                                 <img src="http://placehold.it/300x200" />                                 <figcaption>                                    <div class="icon icon-image"></div>                                 </figcaption>                             </figure>                         </div>                     </td>                 </tr>             </table>         </td>         <td colspan=2 style="padding-top: 12px; padding-right: 12px;">             <center><span style="font-size: 16px; font-weight: bold;">lorem ipsum</span></center>             <br/>lorem ipsum dolor sit amet, prima brute @ cum, ius tota fugit error te, eum quod invidunt. facer fierent iudicabit vix, pri @ illud diceret probatus. maiorum ponderum omittantur te per, pri alterum propriae postulant at. ut pro nostro petentium salutandi.             <p/>est dico stet quaeque no, ei eos dolores dignissim. mei dicunt indoctum deterruisset an, recteque moderatius eu nam. per praesent efficiantur ut, ad mel assum laoreet tincidunt. ad qui agam nullam causae, ut mei minim clita, ut movet verterem democritum est.         </td>     </tr>     <tr><td colspan=6 style="border-top: thin solid gray;">&nbsp;</td></tr> </table> 

 

figure img{display:block}  figure {     display: block;     position: relative;     float: left;     overflow: hidden;     margin:0; padding:0 } figcaption {     display: block;     position: absolute;     background: rgba(255,204,51,0.75);     color: white;     opacity: 0;      -webkit-transition: .6s ease;     -moz-transition: .6s ease;     -o-transition: .6s ease;     transition: .6s ease } figure:hover figcaption {     opacity: 1;     width: 100%;     height: 100%; }  .cap-left figcaption{bottom:0;left:-100%} .cap-left:hover figcaption{left:0} .cap-right figcaption{bottom:0;right:-100%} .cap-right:hover figcaption{right:0} .cap-top figcaption{left:0;top:-100%} .cap-top:hover figcaption{top:0} .cap-bottom figcaption{left:0;bottom:-100%} .cap-bottom:hover figcaption{bottom:0}  .icon { line-height: 1; } .icon:link, .icon:visited, .icon:focus { color: #000; } .icon-image {     position: absolute;     top: 42%;     left: 47%;     font-size: 24px; } .icon-image:before{content: "x"} 

.cap-bottom:hover figcaption {   top: 0; }  .cap-bottom figcaption {   left: 0;   top: 100%;   width: 100%;   height: 100%; } 

change css above :)

hope helps you


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -