Last active
December 15, 2015 03:09
-
-
Save cobbman/5192224 to your computer and use it in GitHub Desktop.
jQuery: create hover effects that mimic CSS :hover pseudo elements. This is needed for iOS devices which don't seem to acknowledge :hover.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************* | |
rollover effects for iOS devices for multiple | |
elements on a page. | |
see this in action here: www.sharenpay.com | |
*********************************************/ | |
$(document).ready(function() { | |
$('.spider-popup').hide(); // hide all the popups at first | |
$('.spider-circle').mouseover(function() { | |
$(this).find('.spider-popup').show(); // when user hovers over circle, show popup | |
}); | |
$('.spider-circle').mouseout(function() { | |
$('.spider-popup').hide(); // when user leaves, hide popup again | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="spider-circle"> | |
<div class="spider-popup"> | |
<p class="spider-popup-content">Easily pay for services you use: salon, dentist, etc.</p> | |
</div> <!-- .spider-popup --> | |
</div> <!-- .spider-circle --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment