Con l'effetto tooltip di Jquery si ottiene questo effetto
http://cssglobe.com/lab/tooltip/03/
Si assoccia ad un link un'immagine.
codice:
<div id="footer">
<ul class="social"> [*][*][*][*]
[/list]
L'immagine poi si puo spostare lungo gli assi, questo è il codice che ci permette di farlo
codice:
/*
* Url preview script
* powered by jQuery (http://www.jquery.com)
*
* written by Alen Grakalic (http://cssglobe.com)
*
* for more info visit http://cssglobe.com/post/1695/easies...w-using-jquery
*
*/
this.screenshotPreview = function(){
/* CONFIG */
xOffset = -20;
yOffset = -650;
// these 2 variable determine popup's distance from the cursor
// you might want to adjust to get the right result
/* END CONFIG */
$("a.screenshot").hover(function(e){
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "
" + this.t : "";
$("body").append("<p id='screenshot'>[img]"+ this.rel +"[/img]"+ c +"</p>");
$("#screenshot")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px")
.fadeIn("fast");
},
function(){
this.title = this.t;
$("#screenshot").remove();
});
$("a.screenshot").mousemove(function(e){
$("#screenshot")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px");
});
};
// starting the script on page load
$(document).ready(function(){
screenshotPreview();
});
Il mio problema è che dovrei utilizzare il tooltip tre diverse volte con tre immagini agrandezza diversa e la distanza
xOffset = -20;
yOffset = -650;
non va bene per tutte e tre.
Vorrei sapere se è quindi possibile cambiare la distanza delle immagini per i vari link.