Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On page load, if cookie set then hide div?

Status
Not open for further replies.

GuitarLord

Technical User
Jun 15, 2009
1
YU
Hi there,

I'm not very good with Javascript so I need you help for page on my website...

Basically what I need to do is to make a DIV shown only first time someone visits page, and then when he/she revisit it I want that same DIV hidden, and I want it hidden for next 24 hours... so in that way DIV would be shown only once a day, and only on first page load.

So to make that happen I need to do fallowing, and I would need your help for that: I need a script that on a page load checks if cookie (which is 24h cookie) is set, if it is then it should hide that DIV, if it is not set then it should set it, so that DIV would be hidden on next page load...

Can someone help me with this, cause I am getting mad trying to do this whole day...

Thanks people!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top