Login | Register | FAQ
Anonymous

Help?

+ Post a reply

13 posts 1, 2


Help?

by soccerwebsitemaker » Mon Aug 20, 2012 12:09 am

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>&otimes;</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>&otimes;</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.
User avatar

soccerwebsitemaker

  • Posts: 139
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at http://www.coinawards.net63.net/

Re: Help?

by soccerwebsitemaker » Mon Aug 20, 2012 11:29 pm

Oh, I forgot to mention. The site that this is displayed on: http://www.coinawards.net63.net/
User avatar

soccerwebsitemaker

  • Posts: 139
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at http://www.coinawards.net63.net/

Re: Help?

by XainPro » Tue Aug 21, 2012 10:12 am

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
User avatar

XainPro

  • Posts: 3762
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Help?

by soccerwebsitemaker » Tue Aug 21, 2012 10:21 am

Oh yes it is on the left side

right 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!
User avatar

soccerwebsitemaker

  • Posts: 139
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at http://www.coinawards.net63.net/

Re: Help?

by XainPro » Tue Aug 21, 2012 10:43 am

still unable to find its really secret !
User avatar

XainPro

  • Posts: 3762
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Help?

by soccerwebsitemaker » Tue Aug 21, 2012 8:34 pm

Ok I guess it's working then, but I will now color the area black so that you can find it.

Please try again!
User avatar

soccerwebsitemaker

  • Posts: 139
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at http://www.coinawards.net63.net/

Re: Help?

by XainPro » Wed Aug 22, 2012 8:33 am

in your script simple make this change
if (ts >= 1)
User avatar

XainPro

  • Posts: 3762
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Help?

by soccerwebsitemaker » Wed Aug 22, 2012 7:44 pm

But that doesn't make it fade out like its supposed to if you hover over it twice!?
User avatar

soccerwebsitemaker

  • Posts: 139
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at http://www.coinawards.net63.net/

Re: Help?

by XainPro » Thu Aug 23, 2012 4:33 am

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 !
User avatar

XainPro

  • Posts: 3762
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Help?

by soccerwebsitemaker » Thu Aug 23, 2012 7:35 pm

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
User avatar

soccerwebsitemaker

  • Posts: 139
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at http://www.coinawards.net63.net/


+ Post a reply

1, 2