gjoellee
March 25th, 2009, 03:16 PM
I am creating something I call a "hoverbox". It is the same thing as you can find on www.crystalxp.net (http://www.crystalxp.net) (the menu with some images below, and when the cursor get's over it the information (the text above) changes).
However I have some problems. See how it looks on www.kshoster.net (http://www.kshoster.net) .
Don't worry about the text, I know how to fix that issue, but look at the images! They are shown in <ul><li> list that is supposed to go horizontal and without the "dots" in from of the icons!
I am not sure what is going wrong, so here is some files i think you might need to look at.
this in the hoverbox.css:
/* Hoverbox.css */
div#hoverContainer {
width: 400px;
height: 200px;
margin: 0;
padding: 0;
}
div#hoverContainer #textBox {
width: 100%;
height: 80%;
padding: 2px;
}
div#hovercontainer #iconDock {
width: 100%;
height: 60px;
background: url('img/bg.png');
}
div#hoverContainer #icondock ul {
display: inline;
width: 100%;
}
div#hoverContainer #icondock ul li {
display: inline;
width: 40px;
}
div#iconDock ul li a {
padding-left: 48px;
padding-bottom: 28px;
padding-right: 10px;
}
div#iconDock ul li a:hover {
padding-left: 48px;
padding-bottom: 28px;
}
/*Special menu item images*/
div#iconDock ul li a#about {
background: url('img/about.png') no-repeat;
}
div#iconDock ul li a#tux {
background: url('img/tux.png') no-repeat;
}
div#iconDock ul li a#media {
background: url('img/media.png') no-repeat;
}
div#iconDock ul li a#tipstricks {
background: url('img/tipstricks.png') no-repeat;
}
div#iconDock ul li a#downloads {
background: url('img/downloads.png') no-repeat;
}
/*Special menu item hover images*/
div#iconDock ul li a#about:hover {
background: url('img/about_hover.png') no-repeat;
}
div#iconDock ul li a#tux:hover {
background: url('img/tux_hover.png') no-repeat;
}
div#iconDock ul li a#media:hover {
background: url('img/media_hover.png') no-repeat;
}
div#iconDock ul li a#tipstricks:hover {
background: url('img/tipstricks_hover.png') no-repeat;
}
div#iconDock ul li a#downloads:hover {
background: url('img/download_hover.png') no-repeat;
}this is the php file that makes the hoverbox appear:
<?php
$about = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/about.txt"));
$tux = nl2br(file_get_contents("./hoverbox/hoverbox/tux.txt"));
$media = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/media.txt"));
$tipstricks = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/tipstricks.txt"));
$downloads = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/downloads.txt"));
$default = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/default.txt"));
?>
<html>
<body>
<div id="hoverContainer">
<div id="textBox">
<?php echo $default; ?>
</div>
<div id="iconDock">
<ul id="vertical" title="Vertical">
<li><a id="about" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $about; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="?c=about"></a></li>
<li><a id="tux" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $tux; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/node/49"></a></li>
<li><a id="media" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $media; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/node/4"></a></li>
<li><a id="tipstricks" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $tipstricks; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/forum/3"></a></li>
<li><a id="downloads" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $downloads; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/node/13"></a></li>
</ul>
</div>
</div>
</body>
</html>
However I have some problems. See how it looks on www.kshoster.net (http://www.kshoster.net) .
Don't worry about the text, I know how to fix that issue, but look at the images! They are shown in <ul><li> list that is supposed to go horizontal and without the "dots" in from of the icons!
I am not sure what is going wrong, so here is some files i think you might need to look at.
this in the hoverbox.css:
/* Hoverbox.css */
div#hoverContainer {
width: 400px;
height: 200px;
margin: 0;
padding: 0;
}
div#hoverContainer #textBox {
width: 100%;
height: 80%;
padding: 2px;
}
div#hovercontainer #iconDock {
width: 100%;
height: 60px;
background: url('img/bg.png');
}
div#hoverContainer #icondock ul {
display: inline;
width: 100%;
}
div#hoverContainer #icondock ul li {
display: inline;
width: 40px;
}
div#iconDock ul li a {
padding-left: 48px;
padding-bottom: 28px;
padding-right: 10px;
}
div#iconDock ul li a:hover {
padding-left: 48px;
padding-bottom: 28px;
}
/*Special menu item images*/
div#iconDock ul li a#about {
background: url('img/about.png') no-repeat;
}
div#iconDock ul li a#tux {
background: url('img/tux.png') no-repeat;
}
div#iconDock ul li a#media {
background: url('img/media.png') no-repeat;
}
div#iconDock ul li a#tipstricks {
background: url('img/tipstricks.png') no-repeat;
}
div#iconDock ul li a#downloads {
background: url('img/downloads.png') no-repeat;
}
/*Special menu item hover images*/
div#iconDock ul li a#about:hover {
background: url('img/about_hover.png') no-repeat;
}
div#iconDock ul li a#tux:hover {
background: url('img/tux_hover.png') no-repeat;
}
div#iconDock ul li a#media:hover {
background: url('img/media_hover.png') no-repeat;
}
div#iconDock ul li a#tipstricks:hover {
background: url('img/tipstricks_hover.png') no-repeat;
}
div#iconDock ul li a#downloads:hover {
background: url('img/download_hover.png') no-repeat;
}this is the php file that makes the hoverbox appear:
<?php
$about = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/about.txt"));
$tux = nl2br(file_get_contents("./hoverbox/hoverbox/tux.txt"));
$media = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/media.txt"));
$tipstricks = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/tipstricks.txt"));
$downloads = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/downloads.txt"));
$default = str_replace("\n", "", file_get_contents("./hoverbox/hoverbox/default.txt"));
?>
<html>
<body>
<div id="hoverContainer">
<div id="textBox">
<?php echo $default; ?>
</div>
<div id="iconDock">
<ul id="vertical" title="Vertical">
<li><a id="about" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $about; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="?c=about"></a></li>
<li><a id="tux" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $tux; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/node/49"></a></li>
<li><a id="media" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $media; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/node/4"></a></li>
<li><a id="tipstricks" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $tipstricks; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/forum/3"></a></li>
<li><a id="downloads" onMouseOver="document.getElementById('textBox').innerHTML = '<?php echo $downloads; ?>'" onMouseOut="document.getElementById('textBox').innerHTML = '<?php echo $default; ?>'" href="http://kshoster.net/node/13"></a></li>
</ul>
</div>
</div>
</body>
</html>