Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Remove content in div after visiting
Old 03-06-2011, 03:01 AM Remove content in div after visiting
Junior Talker

Posts: 1
Name: Thomas Anderson
Trades: 0
Hello
Is possibe remove content in div after visiting?
Thank you very much for your help
neotrix is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-06-2011, 05:20 AM Re: Remove content in div after visiting
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
After visiting what?

Hospital, the toilet, your aunt maybe even the page?

And just explain a little more on what you are looking for.

AND if it is the page, the answer is: Yes it is possible but NOT with HTML.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-04-2011, 05:39 AM Re: Remove content in div after visiting
Banned

Posts: 3
Trades: 0
change the div visible property with javascript
oberonplatform is offline
Reply With Quote
View Public Profile Visit oberonplatform's homepage!
 
Old 08-04-2011, 02:35 PM Re: Remove content in div after visiting
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
I suppose you could set an infinite cookie with JavaScript, which just tells the page that you have visited the site and therefore to not display the div.

Using some code from W3Schools, I've come up with this. It displays an alert box if you've been to the website before.

HTML Code:
<script type="text/javascript">
//W3Schools stuff
function setCookie(c_name,value,exdays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name) {
	var i,x,y,ARRcookies=document.cookie.split(";");
	for (i=0;i<ARRcookies.length;i++) {
		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x=x.replace(/^\s+|\s+$/g,"");
		if (x==c_name) {
			return unescape(y);
		}
	}
}
//End W3Schools stuff

var visited = getCookie("visited");
if (visited==null||visited=="") {
	window.onbeforeunload=setCookie("visited","yes",99999);
}
else {
	alert("You've been here before!");
	//Add your own JS here
}
</script>
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Remove content in div after visiting
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.91613 seconds with 12 queries