jQuery-Hovercap is the jQuery plugin that display caption overlays over images.
<head> ... <script src="js/jquery.js"></script> <script src="jquery.hovercap.js"></script> <script> $(function() { $('.target').hovercap({ toggleElement: '.target__caption' }); }); </script> </head> <body> <div class="target"> <div class="target__image"><img src="..." alt=""></div> <div class="target__caption">Content...</div> </div> ... </body>
$(function() { $('.target').hovercap({ toggleElement: '.example__caption', toggleAnimation: 'fade' }); });
$(function() { $('.target').hovercap({ toggleElement: '.example__caption', toggleAnimation: 'slide', toggleDirection: 'toTop' }); });
$(function() { $('.target').hovercap({ toggleElement: '.example__caption', toggleAnimation: 'slide', toggleDirection: 'toRight' }); });
$(function() { $('.target').hovercap({ toggleElement: '.example__caption', toggleAnimation: 'slide', toggleDirection: 'toBottom' }); });
$(function() { $('.target').hovercap({ toggleElement: '.example__caption', toggleAnimation: 'slide', toggleDirection: 'toLeft' }); });
2014, Sato Daiki.