Don't show this again

Go down

Solved Don't show this again

Post by Niko on Fri Apr 27, 2012 11:40 am

Hello,

I made a search on Google
Spoiler:
and I haven't found anything...

Well, I want to create a pop-up message that when you click on it it will close and it won't appear again (for the same member)... I have this "table" for now...

Code:
<div id="popup1" onclick="$('#popup').toggle('fast');">Message</div>
What Can I do? Thanks for your help Mr. Green

Notes: I use PunBB and Google Chrome; I will put the code in templates (Forum link in the profile)

Friendly,


Last edited by Niko! on Sun Apr 29, 2012 7:39 am; edited 1 time in total
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Solved Re: Don't show this again

Post by LGforum on Fri Apr 27, 2012 4:46 pm

You must save a cookie in order to know whether or not the user has experienced the pop up.

You can save cookie's using the functions already in forumotions system scripts. my_getcookie() and my_setcookie();

Code:

if(!my_getcookie('popup')) {
  // Java script to pop up your box...

  my_setcookie('popup',1,true);
}
avatar
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Don't show this again

Post by Niko on Sat Apr 28, 2012 6:42 am

Well, I didn't understand...
Can you make it easier for me? Smile
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Solved Re: Don't show this again

Post by LGforum on Sat Apr 28, 2012 5:02 pm

Not really lol its as easy as it gets Razz

I suppose this might be easier...
Code:

<div id="popupbox" style="display:none">
STYLE THIS BOX AND PUT YOUR MESSAGE AND STUFF HERE.
</div>
<script>
if(!my_getcookie('popup')) {
  document.getElementById('popupbox').style.display = '';
  my_setcookie('popup',1,true);
}
</script>
avatar
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Don't show this again

Post by Niko on Sun Apr 29, 2012 7:36 am

Solved!! Mr. Green
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum