Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTML links do not work! + other

    Well first off here are my files:

    index.html:
    Code:
    <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:
    Code:
    /****************************************************
     * 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:
    Code:
    /****************************************************
     * 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?

  • #2
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, my copyright id has an extra space at the bottom. How can I fix this?

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Bump.

  • #4
    Regular Coder
    Join Date
    Oct 2006
    Posts
    164
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Website URL?

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    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.
    OracleGuy

  • #6
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Fixed, thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •