Forum Moderators: open
Here's my code:
<a class="link1" href="http://www.example.com" target="myFrame">Some Text</a>
<style>
a.link1:link {
margin: 1;
display: block;
width: 200px;
color: yellow;
background-color: #0033ff;
text-decoration: none;
font-size:.95em;
}
a.link1:visited {
margin: 1;
display: block;
width: 200px;
color: yellow;
background-color: #0033ff;
text-decoration: none;
font-size:.95em;
}
a.link1:active{
color:white;
margin-left:2px;
background-position:left center;
background-repeat:no-repeat;
background-image:url(../_images/url_arrow.gif);
text-indent:1em;
padding-right:0px;
font-style:italic;
cursor:default; /*Make mouse pointer an arrow to discourage clicking */
}
a.link1:hover {
color: blue;
background-color: #fff;
text-decoration: none;
}
</style>
<style>
body{line-height:1em}
a.link1:link {
margin: 1;
display: block;
width: 200px;
color: yellow;
background-color: #0033ff;
text-decoration: none;
font-size:.95em;
}a.link1:visited {
margin: 1;
display: block;
width: 200px;
color: yellow;
background-color: #0033ff;
text-decoration: none;
font-size:.95em;
}
a.link1:active{
color:blue;
padding-left:5px;
background-position:left center;
background-repeat:no-repeat;
background:url(http://www.example.com/myblog/images/x_ico.gif) no-repeat left center;
text-indent:1em;
padding-right:0px;
font-style:italic;
cursor:default; /*Make mouse pointer an arrow to discourage clicking */
}
a.linked{
padding-left:5px;
background:url(http://www.example.com/myblog/images/x_ico.gif) no-repeat left center;
text-indent:1em;
cursor:default; /*Make mouse pointer an arrow to discourage clicking */
}
a.link1:hover {
padding-left:5px;
text-indent:1em;
color: blue;
background:#fff url(http://www.example.com/myblog/images/x_ico.gif) no-repeat left center;
text-decoration: none;
}
</style>
<a class="link1" href="#">Some Text</a><br />
<a class="link1" href="#">Some Text</a><br />
<a class="link1" href="#">Some Text</a><br />
<a class="link1" href="#">Some Text</a><br />
<script type="text/javascript">
var hrefs=document.getElementsByTagName("a");
var preA="";
for(var i=0;i<hrefs.length;i++){
hrefs[i].onclick=function(){
if(preA!="" && preA!=this){
preA.className="link1";
}
this.className="link1 linked";
preA=this;
}
}
</script>
[edited by: encyclo at 4:48 pm (utc) on May 13, 2007]
[edit reason] examplified, see terms of service [/edit]