Help?
Help?
Hi, I need some help on this code: there are 2 problems.One problem is that when you hover over the 'secret coin' (left side, 2nd column, 5th from the top) and then you hover over again quickly, the grey box above that appears doesn't disappear like it should. Also, the 'x' in the corner doesn't close the window even though there are no errors in the code or misprints.
please read this code (JavaScript and some HTML)
HTML (relevant to JS)
- Code: Select all
<div id="secretcoin" onmouseover="addAward()">
</div>
JavaScript(JS):
- Code: Select all
<script>
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()
{
if (ts == 1)
{
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";
divTag.innerHTML = "<div id='closeit'><big><big><big>⊗</big></big></big></div>Congratulations! You have <span class='highlite-blue'>found the secret coin</span>!<br>" + ADVAR;
document.body.appendChild(divTag);
setInterval(hideAwardBox, 5000);
}
if (ts == 0)
{
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";
divTag.innerHTML = "<div id='closeit'><big><big><big>⊗</big></big></big></div>Congratulations! You have <span class='highlite-blue'>found the secret coin</span>!<br>" + DBVAR;
document.body.appendChild(divTag);
setInterval(hideAwardBox, 5000);
ts += 1;
}
}
function hideAwardBox()
{
$('#newachievementdiv').fadeOut('slow');
ts = 0;
}
var closeit = $('#closeit');
var nad = $('#newachievementdiv');
closeit.click(function()
{
nad.style.display = "none";
});
</script>
Thanks for reviewing and try to see the error because I can't.
Re: Help?
Oh, I forgot to mention. The site that this is displayed on: http://www.coinawards.net63.net/Re: Help?
soccerwebsitemaker wrote:Oh, I forgot to mention. The site that this is displayed on: http://www.coinawards.net63.net/
and please also mention where is the secret coin located ? @lol
Re: Help?
Oh yes it is on the left sideright column
5th from the top
just hover over it and a grey box should appear next to "Welcome to CoinAwards"
Thank You and please help!
Re: Help?
still unable to find its really secret !Re: Help?
Ok I guess it's working then, but I will now color the area black so that you can find it.Please try again!
Re: Help?
in your script simple make this changeif (ts >= 1)
Re: Help?
But that doesn't make it fade out like its supposed to if you hover over it twice!?Re: Help?
that's because you have added $ts += 1 on mouse over and every time you mouse over will increase $ts 1 time if you hover mouse 10 times then it ts will become 10 simply replace ts += 1 with ts = 1.i think this will surely help you out !
Re: Help?
Thanks, that solves a problem that I wasn't looking at directly but needed attention. Now, the window is displaying the correct things.However, even though the box fades out the first time you hover over it, it doesn't fade out the second or third of fourth (etc) time you hover over it.
Can that be fixed??
Thanks