javascript - how to make a double hover effect with css -


i have double hover effect not it. avoid transition leaving appeared icon.

maybe here. suggestion welcome.

here html:

http://jsfiddle.net/cb5lr/

<div class="block image addmore" style="position: absolute; top: 100px; left: 50px; height: 350px;width:200px;background-color:red;">     <span data-action="fullview" class="shopicons full_screen_icon"></span>     <figure class="with-hidden-caption">          please hover here. after second icon apear in right corner.         <br><br>         if hover icon change. until here ok.<br><br>         but, if leave icon, shout show old 1 without rolling effekt.     </figure> </div> 

and css:

.shopicons {     background: url("http://www.dasunddas.de/img/base/shop_icons.png?v=63") no-repeat scroll 0 0 transparent;  }  span.full_screen_icon {     background-position: 0px 0px;     cursor: pointer;     opacity: 0;     height: 45px;     position: absolute;     right: -45px;     top: -45px;     width: 45px;     z-index: 10;     transition-duration: .6s;     transition-delay: 1s;     /*    transition: all;   */ }  span.full_screen_icon:hover {     background-position: 0px -50px;     transition-delay: 0s;     transition-duration: 0s; }  div.addmore:hover span.full_screen_icon {     opacity: 1;     right: 0;     top: 0; } 

http://jsfiddle.net/cb5lr/

well, first idea, use :after (or element inside span) because somehow need add element play hover > hover:

http://jsfiddle.net/cb5lr/7/

.shopicons {   background: url("http://www.dasunddas.de/img/base/shop_icons.png?v=63") no-repeat scroll 0 0 transparent;   }  span.full_screen_icon {     background-position: 0px 0px;     cursor: pointer;     opacity: 0;     height: 45px;     position: absolute;     right: -45px;     top: -45px;     width: 45px;     z-index: 10;     transition-duration: .6s;     transition-delay: 1s; }  span.full_screen_icon:after {     content: "";     display: none;     width: 45px;     height: 45px;     position: absolute;     top: 0;     left: 0;     background: url("http://www.dasunddas.de/img/base/shop_icons.png?v=63") no-repeat scroll 0 -50px transparent; }  span.full_screen_icon:hover:after {     display: block; }  div.addmore:hover span.full_screen_icon {     opacity:1;     right: 0;     top: 0; } 

this tricky!


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -