Page 1 sur 1

Tooltip ouverture/fermeture sur onclick

Posté : 23 févr. 2012, 10:54
par lecer144
Bonjour à tous,
J'ai une fonction qui envoi des infos à wz_tooltip.js. Pour le moment elle permet d'ouvrir une tooltip avec mouseover mais du coup dès qu'on fait un mouseout, la tooltip disparait et du coup on ne peut pas pointer la souris sur la tooltip pour faire dérouler les ascenceurs si le contenu est très long.
J'ai bien tenté quelques modifs avec onclick à la place de mouseouver mais sans grand succès ... la fonction envoyant tout dans une variable, je me demande même si c'est réalisable ... si vous pouviez me dire si au moins c'est jouable.
Par avance merci.
/**
 * Utility function to provide ToolTips
 *
 * @param string $tooltip ToolTip text
 * @param string $title The Box title
 * @param string $image
 * @param int $width
 * @param string $text
 * @param string $href
 * @param string $link
 * @return string HTML code for ToolTip
 */
function vmToolTip( $tooltip, $title='Tip!', $image = "{mosConfig_live_site}/images/M_images/con_info.png", $width='650', $text='', $href='#', $link=false ) {
	global $mosConfig_live_site, $database;
	
	defined( 'vmToolTipCalled') or define('vmToolTipCalled', 1);
	$clic = 1; // POUR TEST
	$tooltip = str_replace('"','"',$tooltip);
	$tooltip = $database->getEscaped($tooltip);
	$tooltip = str_replace("'","\'",$tooltip);
	
	if ( !empty($width) ) {
		$width = ',WIDTH, -'.$width;
	}
	if ( $title ) {
		$title = ',TITLE,\''.$title .'\'';
	}
	$image = str_replace( "{mosConfig_live_site}", $mosConfig_live_site, $image);
	if( $image != '' ) {
		$text 	= vmCommonHTML::imageTag( $image, '', 'top' ). ' '.$text;
	}
	
	$style = 'style="text-decoration: none; color: #333;"';
	if ( $href ) {
		$style = '';
	}
	if ( $link ) {
		$tip = vmCommonHTML::hyperLink( $href, $text, '','', "onmouseover=\"Tip( '$tooltip' );\" onmouseout=\"UnTip()\" ". $style );
	} else {
		$tip = "<span onmouseover=\"Tip( '$tooltip' $width $title );\" onmouseout=\"UnTip()\" ". $style .">". $text ."</span>"; // ORIGINAL
		/* DEBUT TEST
                                if ($clic==0){$clic=1;
				$tip = "<span onclick=\"Tip( '$tooltip' $width $title );\" ". $style .">". $text ."</span>";}
		else {$clic=0;
				$tip = "<span onclick=\"UnTip()\" ". $style .">". $text ."</span>";}
                               FIN TEST */
	}

	return $tip;
}