...

View Full Version : HTML links do not work! + other



Ben Sprinkle
01-24-2007, 03:04 AM
Well first off here are my files:

index.html:


<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css">
<script language="javascript" type="text/javascript" src="main.js">
</script>
<title>Ben Sprinkle's Website</title>
</head>
<body>
<div id="header">
<div id="wrapper">
<a href="index.html" id="logo">
<font size="18">Logo</font>
</a>
<div id="tabs">
<ul>
<li id="home" style="background-image: url(images/tab_home.png); background-position: 0pt;" onclick="onTabClick(this)" onmouseover="onTabMouseOver(this)" onmouseout="onTabMouseOut(this)">
<a href="index.html">
<img class="tab_leecher" src="images/leecher.png">
</a>
</li>
<li id="duke" style="background-image: url(images/tab_duke.png); background-position: 0pt 28px;" onclick="onTabClick(this)" onmouseover="onTabMouseOver(this)" onmouseout="onTabMouseOut(this)">
<a href="duke/index.html">
<img class="tab_leecher" src="images/leecher.png">
</a>
</li>
<li id="java" style="background-image: url(images/tab_java.png); background-position: 0pt 28px;" onclick="onTabClick(this)" onmouseover="onTabMouseOver(this)" onmouseout="onTabMouseOut(this)">
<a href="java/index.html">
<img class="tab_leecher" src="images/leecher.png">
</a>
</li>
</ul>
</div>
<script language="javascript" type="text/javascript">
var e = document.getElementById('home');
if(e) onTabClick(e);
</script>
</div>
</div>
<div id="content">
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div id="copyright">
<br><br>
This website has been coded with anti-leech technology
<br>
Copyright 2006-2007 Ben Sprinkle
<br><br><br>
</div>
</div>
</body>
</html>

main.js:


/****************************************************
* The main JavaScript file for www.bensprinkle.org *
****************************************************/
function onTabClick(e) {
e.style.backgroundPosition = '0 0';
e.onmouseover = function() {};
e.onmouseout = function() {};
}
function onTabMouseOut(e) {
e.style.backgroundPosition = '0 28px';
}
function onTabMouseOver(e) {
e.style.backgroundPosition = '0 56px';
}

main.css:


/****************************************************
* The main css style sheet for www.bensprinkle.org *
****************************************************/
body {
background-color: #333333;
margin:0;
padding:0;
margin-bottom:10px;
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
color:#ffffff;
}
#copyright {
width:100%;
border-top:1px solid #999999;
border-left:1px solid #999999;
border-right:1px solid #999999;
position:relative
font-size:10px;
text-align:center;
background-image:url(images/wrapper_bg.png);
}
#content {
position:relative;
width:1000px;
margin:0 auto 0 auto;
z-index:2000;
}
#header {
position:relative;
width:1000px;
height:23px;
line-height:23px;
margin-left:auto;
margin-right:auto;
font-size:10px;
}
img.tab_leecher {
width:97px;
height:28px;
border:none;
}
#logo {
position:relative;
width:356px;
height:82px;
left:2px;
top:32px;
border:none;
}
#tabs {
position:absolute;
top:94px;
right:4px;
width:499px;
height:28px;
z-index:9999;
}
#tabs ul {
position:absolute;
left:0px;
top:0px;
height:28px;
width:505px;
margin:0;
padding:0;
list-style:none;
clear:both;
float:none;
overflow:hidden;
z-index:150;
}
#tabs ul li {
position:relative;
width:97px;
height:28px;
margin:0;
margin-right:4px;
padding:0;
float:left;
overflow:hidden;
background-position:0px 28px;
}
#wrapper {
position:absolute;
left:0;
top:0;
width:100%;
height:121px;
background-image:url(images/wrapper_bg.png);
border-bottom:1px solid #999999;
border-left:1px solid #999999;
border-right:1px solid #999999;
z-index:10;
}

I have found that my tabs and logo do not retain their href status, there is also no hover effects on the tabs. If I make the tabs positiion to normal it works but the position is out of whack.

Can anyone help me?

Ben Sprinkle
01-24-2007, 03:06 AM
Also, my copyright id has an extra space at the bottom. How can I fix this?

Ben Sprinkle
01-25-2007, 02:41 AM
Bump.

Sman5109
01-25-2007, 02:53 AM
Website URL?

oracleguy
01-25-2007, 03:53 AM
I'd suspect that the onclick event for the list item is overriding the normal behavior of the link it contains. If you remove the onclick event from the list item, does it work?

If that fixes it, you'd need to add some extra code to your javascript so it would also navigate to the correct page when clicked.

Goat Spirit
01-25-2007, 03:15 PM
Fixed, thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum