hi leute, ich wollte in meine seite einen tooltip einbauen.allerdings lässt sich der nicht so anpassen, wie ich das will
ich kann den tooltip nicht anpassen. ich möchte den nämlich fast direkt am mauszzeiger haben...
aber egal was ich hier eigebe, es ändert sich nichts
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>susi.artmessengers.de</title>
<link rel="shortcut icon" href="http://www.psd-tutorials.de/forum/images/favicon.ico" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.tinyscrollbar.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#scrollbar1').tinyscrollbar();
});
</script>
<script type="text/javascript">
<!-- tooltip und jquery slider -->
$(document).ready(function() {
//Tooltips
$(".tip_trigger").hover(function(){
tip = $(this).find('.tip');
tip.show(); //Show tooltip
}, function() {
tip.hide(); //Hide tooltip
}).mousemove(function(e) {
var mousex = e.pageX + 20; //Get X coodrinates
var mousey = e.pageY + 20; //Get Y coordinates
var tipWidth = tip.width(); //Find width of tooltip
var tipHeight = tip.height(); //Find height of tooltip
//Distance of element from the right edge of viewport
var tipVisX = $(window).width() - (mousex + tipWidth);
//Distance of element from the bottom of viewport
var tipVisY = $(window).height() - (mousey + tipHeight);
if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
mousex = e.pageX - tipWidth - 20;
} if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
mousey = e.pageY - tipHeight - 20;
}
//Absolute position the tooltip according to mouse position
tip.css({ top: mousey, left: mousex });
});
</script>
</head>
<body>
<div id="hintergrund">
<img src="http://www.psd-tutorials.de/forum/images/footer.png" width="100%" alt="" /></img>
</div>
<div id="content"> <!-- ANFANG CONTENT -->
<!-- navigation -->
<div id="navigation">
<a href="#"
onmouseover="
home1.src='images/home_hover.png';"
onmouseout="
home1.src='images/home.png'; ">
<img src="http://www.psd-tutorials.de/forum/images/home.png" border="0" alt="logodesign" name="home1"></img></a>
<a href="#"
onmouseover="
flyersnow.src='images/flyersnowaustausch.png';
logodesign1.src='images/logodesign_hover.png';"
onmouseout="
flyersnow.src='images/bildchen.png';
logodesign1.src='images/logodesign.png'; ">
<img src="http://www.psd-tutorials.de/forum/images/logodesign.png" border="0" alt="logodesign" name="logodesign1"></img></a>
<a href="#"
onmouseover="
illustrationen1.src='images/illustrationen_hover.png';"
onmouseout="
illustrationen1.src='images/illustrationen.png'; ">
<img src="http://www.psd-tutorials.de/forum/images/illustrationen.png" border="0" alt="logodesign" name="illustrationen1"></img></a>
<a href="#"
onmouseover="
webdesign1.src='images/webdesign_hover.png';"
onmouseout="
webdesign1.src='images/webdesign.png'; ">
<img src="http://www.psd-tutorials.de/forum/images/webdesign.png" border="0" alt="logodesign" name="webdesign1"></img></a>
<a href="#"
onmouseover="
printdesign1.src='images/printdesign_hover.png';"
onmouseout="
printdesign1.src='images/printdesign.png'; ">
<img src="http://www.psd-tutorials.de/forum/images/printdesign.png" border="0" alt="logodesign" name="printdesign1"></img></a>
<a href="#"
onmouseover="
bildbearbeitung1.src='images/bildbearbeitung_hover.png';"
onmouseout="
bildbearbeitung1.src='images/bildbearbeitung.png'; ">
<img src="http://www.psd-tutorials.de/forum/images/bildbearbeitung.png" border="0" alt="logodesign" name="bildbearbeitung1"></img></a>
</div>
<div id="raster">
<div id="scrollbar1">
<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name="flyersnow" border="0"/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
<a href="#" class="tip_trigger"><img src="http://www.psd-tutorials.de/forum/images/bildchen.png" alt="" name=""/><span class="tip">der text</span></img></a>
</div>
</div>
</div>
</div><!-- ENDE raster -->
</div> <!-- ENDE CONTENT -->
</body>
</html>
ich kann den tooltip nicht anpassen. ich möchte den nämlich fast direkt am mauszzeiger haben...
aber egal was ich hier eigebe, es ändert sich nichts
HTML:
if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
mousex = e.pageX - tipWidth - 20;
} if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
mousey = e.pageY - tipHeight - 20;
Zuletzt bearbeitet: