Javascript Vote Reminder [closed]

hioenrtaks

New Member
I have been trying to make a vote reminder for my website. I own a game server and people vote for in-game rewards. I was to make it so it only pops up once per 24 hours, Basically I want it so they log on to main site, a IN-PAGE popup comes up and they click either "Vote Now" Or "I already Voted" If they click vote now it will bring them to the vote page. If they click "I already voted" it will close and then a TEXT POPUP will come up saying "You Will Be Reminded Tomorrow!" Then they can continue to browse through the site and such. And then after 24 hours it will expire and the reminder will popup when they vist the site again. Can anyone help me here? I know its a lot but I have attempted many times to do this and this is my last resort trust me. So I basically need the JavaScript part or help with the part.This is what ive tried so far but it doesnt work, It still shows it each time for like 8 seconds before the page loads\[code\] <html> <head> <script language="javascript"> function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var flag = 0; var dcmntCookie = document.cookie.split(';'); for(var i=0;i < dcmntCookie.length;i++) { var ck = dcmntCookie; while (ck.charAt(0)==' ') { ck = ck.substring(1,ck.length); } if(ck) { cparts = ck.split('='); if (cparts[0]==name) { flag=1; document.getElementById('charlesvien').style.display="none"; document.getElementById('charlesvien').style.visibility="hidden"; // hiding the div break; } } } if(!flag) createCookie(name,"Voter1",1); } window.onload = function vote_popup() { if (fuckingsmegal == null) { document.getElementById('vote_popup').style.display = "block"; } } function hide_vote_popup() { document.getElementById('vote_popup').style.display = "none"; document.getElementById('vote_popup').innerHTML = ""; alert("You will be reminded tomorrow!"); } </script> </head> <body onLoad="readCookie('MyCookie')"> <div id="charlesvien"> <div id="vote_popup" ;="" style="background-image: url(http://img197.imageshack.us/img197/4172/transa.png); background-attachment: scroll; background-color: transparent; width: 100%; height: 100%; position: fixed; left: 0px; right: 0px; top: 0px; bottom: 0px; color: rgb(255, 255, 255); font-size: 9px; text-align: center; z-index: 99999; display: block; background-position: 0% 0%; background-repeat: repeat repeat;"> <center style="padding-top: absolute;"> <br><br><br><br><br><br><br><br> <table class="cv-table" style="align: center; text-align: center;"> <tr> <td> <p class="cv-smeg" style="padding-top: 8px; font-size: 20px;">Vote For Diamonds!</h3> <p class="cv-smeg"><center>- Click the diamond below<br> <a href="http://www.minenation.net/vote" class="cv-a"><img class="cv-img" src="http://i47.tinypic.com/2435e1t.png"></a><br> - Login to the IN-GAME server<br> - Vote for us on each website<br> - Enjoy Your Rewards!<br><br> </center> </p> </td> </tr> </table> <br> <a href="http://stackoverflow.com/questions/13806225/#" onclick="hide_vote_popup();" class="cv-a"><p class="cv-smeg" style="font-size: 13px; color: white;">[I Have Voted Today]</p></a> </center> <style> .cv-table { text-align: center; align: center; border: ridge; color: black; border-color: white; background-image: -ms-linear-gradient(top, #FFFF00 0%, #EFB700 100%); background-image: -moz-linear-gradient(top, #FFFF00 0%, #EFB700 100%); background-image: -o-linear-gradient(top, #FFFF00 0%, #EFB700 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FFFF00), color-stop(1, #EFB700)); background-image: -webkit-linear-gradient(top, #FFFF00 0%, #EFB700 100%); background-image: linear-gradient(to bottom, #FFFF00 0%, #EFB700 100%); } .cv-smeg { padding-right: 10px; padding-left: 10px; color: black; font-weight: bold; } .cv-img { padding: 10px; } .cv-a { text-decoration: none; } .cv-table:hover { border-color: blue; } </style></style></div></div></div></body></html>\[/code\]
 
Back
Top