I've been troubleshooting why my add to bookmark javascript isn't functioning when clicked. It seems like the issue may be related to the divs being positioned absolutely, as it works fine when I remove all the divs and just keep the link. Below are snippets of my CSS, HTML, and JavaScript code.
html {
width:100%;
height:100%;
}
body {
background: #403F3D url(images/background.png) top center fixed;
margin:0;
padding:0;
font-family: Verdana, Arial, Helvetica, sans-serif;
color:#444;
font-size:12px;
line-height:1.9em;
text-align: center;
}
* {
margin:0;
padding:0;
}
#container {
position:absolute;
top: -10px;
left: 50%;
margin-left: -447.5px;
text-align:left;
}
#bookmark {
position:absolute;
left:222px;
top:343px;
width:282px;
height:46px;
}
<div id="container">
<div id="bookmark">
<a href="javascript:bookmarksite('WoW Mania - World of Warcraft Gameplay Guide', 'http://www.wowmania.net')">
<img src="images/bookmark.png" class="domroll images/active-bookmark.png"></a>
</div>
</div>
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}