gracias por su solución. Tuve el mismo problema en un proyecto. El problema era que aparecía un título feo y largo cuando movía la imagen y necesitaba el título en emergente porque en el atributo de título, coloco un enlace de compra a un producto. pero, como dije, un título largo que incluye una etiqueta también aparece al pasar el mouse sobre él. así que acabo de agregar una función .click al final de su solución, no sé si es posible resolver esto de una manera más semántica, ya que no soy un experto en jquery. la secuencia de comandos completa se pega a continuación, respecto :)
$(".collection-box a").hover(function(){
// Get the current title
var title = $(this).attr("title");
// Store it in a temporary attribute
$(this).attr("tmp_title", title);
// Set the title to nothing so we don't see the tooltips
$(this).attr("title","");
},
function() { // Fired when we leave the element
// Retrieve the title from the temporary attribute
var title = $(this).attr("tmp_title");
// Return the title to what it was
$(this).attr("title", title);
});
//Restore the title on click
$(".collection-box a").click(function(){
// Retrieve the title from the temporary attribute
var title = $(this).attr("tmp_title");
// Return the title to what it was
$(this).attr("title", title);
});
$ (este) .data() es un lugar muy útil para almacenar ese tipo de cosas. +1 por mencionarlo. :-) –
gracias! esta solución es interesante! ¿puedo saber cómo puedo usar esta información almacenada? Necesito pasar los datos a una var como esta es mi var path original = $ (this) .attr ("title"); ¡Gracias! – laukok
$ (this) .data ("title") le dará acceso a los datos almacenados. – FRotthowe