Created
October 16, 2014 10:17
-
-
Save yanis-git/2b80afc384a9666d4696 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
jQuery(document).ready(function($) { | |
/** | |
* Demo Section : Mettre en avant ses alternatives textuelles sur les devices tactiles. | |
**/ | |
$("a[data-toggle='tooltip'], img[data-toggle='tooltip']").on("click",function(){ | |
if(!$('.tooltip').hasClass('in')){ //Si l'info-bulle n'est pas visible. | |
$(this).tooltip("show"); | |
return false; // Empecher le navigateur d'ouvrir la destination du lien. | |
} | |
}); | |
$(document).click(function(){ //Désactiver l'info-bulle quand on clique autre part. | |
$("a[data-toggle='tooltip'], img[data-toggle='tooltip']").tooltip("hide"); | |
}); | |
$("a[data-toggle='tooltip'], img[data-toggle='tooltip']").on("focus",function(){ | |
$(this).tooltip("destroy"); | |
}); | |
$("a[data-toggle='tooltip'], img[data-toggle='tooltip']").on("hover",function(){ | |
$(this).tooltip("destroy"); | |
}); | |
$("a[data-toggle='tooltip'], img[data-toggle='tooltip']").dblclick(function(){ | |
window.location.href = $(this).attr("href"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment