Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    tooltip con jquery by Alen Grakalic

    Ciao Raga,
    Urge aiutino !

    Non essendo un drago in js ho bisogno di capire come faccio a far visualizzare il tooltip alla sinistra invece che alla destra, qualcuno può aiutarmi ?

    10ks

    codice:
    /*
     * Tooltip 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.tooltip = function(){	
    	/* CONFIG */		
    		xOffset = 10;
    		yOffset = 20;		
    		// these 2 variable determine popup's distance from the cursor
    		// you might want to adjust to get the right result		
    	/* END CONFIG */		
    	$("a.tooltip").hover(function(e){											  
    		this.t = this.title;
    		this.title = "";									  
    		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
    		$("#tooltip")
    			.css("top",(e.pageY - xOffset) + "px")
    			.css("left",(e.pageX + yOffset) + "px")
    			.fadeIn("fast");		
        },
    	function(){
    		this.title = this.t;		
    		$("#tooltip").remove();
        });	
    	$("a.tooltip").mousemove(function(e){
    		$("#tooltip")
    			.css("top",(e.pageY - xOffset) + "px")
    			.css("left",(e.pageX + yOffset) + "px");
    	});			
    };
    
    
    
    // starting the script on page load
    $(document).ready(function(){
    	tooltip();
    });



    .

  2. #2

    Re: tooltip con jquery by Alen Grakalic

    Sorry !
    Mi rispondo da solo !
    Era sufficiente mettere un valore negativo per la coordinata Y (yOffset)
    pari alla dimensione del css + almeno 10 px per la distanza del cursore, quindi da un valore positivo di 20 l'ho portato a -220 e adesso funge.



    10ks

    codice:
    this.tooltip = function(){	
    	/* CONFIG */		
    		xOffset = 10;
    		yOffset = -220;		
    		// these 2 variable determine popup's distance from the cursor
    		// you might want to adjust to get the right result		
    	/* END CONFIG */



    .

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.