Ok, so far, I have a website called
http://www.coinawards.net63.net/
This site is under development, and I am currently trying to make a 'secret coin.' By this, I mean a coin on one of the sides of the page that if you hover over it, a small grey box appears next to the 'Welcome to CoinAwards' title.
Everything is going good, except for some weird problem. If you hover over the coin once, a message box appears and it safely hovers away.
But, if you hover over it twice, it DOES NOT fade away like its supposed to - EVEN THOUGH I'VE CHECKED IT A MILLION TIMES!
So can anyone help me with this problem?
Here is the necessary code for solving this error:
JavaScript
:
Code:
var ts = 0;
var DBVAR = "Rewards:<br>+120 Coins<br>+10 Skill Points<br>+1 Award";
var ADVAR = "You have already completed this achievement";
function addAward()
{
var divTag = document.createElement("div");
divTag.id = "newachievementdiv";
divTag.setAttribute("align","center");
divTag.style.margin = "0px auto";
divTag.style.position = "fixed";
divTag.style.left = "250px";
divTag.className = "awardBox";
if (ts == 0)
{
divTag.innerHTML = "Congratulations! You have <span class='highlite-blue'>found the secret coin</span>!<br>" + DBVAR;
ts = 1;
}
else
{
divTag.innerHTML = "Congratulations! You have <span class='highlite-blue'>found the secret coin</span>!<br>" + ADVAR;
ts = 1;
}
setInterval(hideAwardBox, 5000);
document.body.appendChild(divTag);
}
function hideAwardBox()
{
$('#newachievementdiv').fadeOut('slow');
}
Couple of lines of HTML:
<div id="secretcoin" onmouseover="addAward()">
</div>
I think that it will help if you visit the site this is displayed on:
http://www.coinawards.net63.net/
Also, the 'secret coin' in question that you must hover over is the black highlited area down below on the left side.
Thank You.