Zaloguj | Zarejestruj | FAQ
Anonymous

Help?

+ Odpowiedz

Posty: 13 1, 2


Help?

przez soccerwebsitemaker » Pn sie 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)



Kod: Zaznacz cały
<div id="secretcoin" onmouseover="addAward()">

</div>






JavaScript(JS):





Kod: Zaznacz cały
<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.
Avatar użytkownika

soccerwebsitemaker

  • Posty: 138
  • Dołączył(a): So gru 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

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

Re: Help?

przez soccerwebsitemaker » Pn sie 20, 2012 11:29 pm

Oh, I forgot to mention. The site that this is displayed on: http://www.coinawards.net63.net/
Avatar użytkownika

soccerwebsitemaker

  • Posty: 138
  • Dołączył(a): So gru 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

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

Re: Help?

przez XainPro » Wt sie 21, 2012 10:12 am

soccerwebsitemaker napisał(a):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
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Help?

przez soccerwebsitemaker » Wt sie 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!
Avatar użytkownika

soccerwebsitemaker

  • Posty: 138
  • Dołączył(a): So gru 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

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

Re: Help?

przez XainPro » Wt sie 21, 2012 10:43 am

still unable to find its really secret !
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Help?

przez soccerwebsitemaker » Wt sie 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!
Avatar użytkownika

soccerwebsitemaker

  • Posty: 138
  • Dołączył(a): So gru 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

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

Re: Help?

przez XainPro » Śr sie 22, 2012 8:33 am

in your script simple make this change
if (ts >= 1)
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Help?

przez soccerwebsitemaker » Śr sie 22, 2012 7:44 pm

But that doesn't make it fade out like its supposed to if you hover over it twice!?
Avatar użytkownika

soccerwebsitemaker

  • Posty: 138
  • Dołączył(a): So gru 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

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

Re: Help?

przez XainPro » Cz sie 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 !
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Help?

przez soccerwebsitemaker » Cz sie 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
Avatar użytkownika

soccerwebsitemaker

  • Posty: 138
  • Dołączył(a): So gru 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

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


+ Odpowiedz

1, 2