Hello,
Does anyone have a script that removes a picture after a certain time? I guess this would be considered a timer action script.
Thanks
Hello,
Does anyone have a script that removes a picture after a certain time? I guess this would be considered a timer action script.
Thanks
"remove" is not very clear in this case. I don't know of any scripts in particular that exist for this, but it would certainly be possible to make one, depending on what you mean specifically.
Do you want to use Javascript? You just want to hide an image if it is past a certain time? You could look into scripts that display images at certain times and modify them to instead hide images (for example,element.style.display = 'none';).
If you do use this method, though, it will be possible to find the image in the source code. Javascript can't do anything about that because it only changes what has already loaded.
If you want to completely "remove" an image from your page so that no one can find it at all, you will need to use a serverside language like PHP-- but instead of "removing" it you just won't generate it in the first place.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> </head> <body> <img id="tst1" src="http://www.vicsjavascripts.org.uk/StdImages/Egypt5.jpg" /> <img id="tst2" src="http://www.vicsjavascripts.org.uk/StdImages/Egypt6.jpg" /> <script type="text/javascript"> /*<![CDATA[*/ function Remove(id,ms){ var obj=document.getElementById(id); if (obj&&typeof(ms)=='number'){ setTimeout(function(){ obj.parentNode.removeChild(obj); },ms); } } Remove('tst1',4000) Remove('tst2',3000) /*]]>*/ </script> </body> </html>
Vic
God Loves You and will never love you less.
http://www.vicsjavascripts.org/Home.htm
If my post has been useful please donate to http://www.operationsmile.org.uk/
That script uses a delay (for example, 10 seconds) to remove an image. My suggestions were about absolute time (time of day, or date).
Rydorien, which of these did you want?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks