Hi everyone!
I've been trying to find a script that hides text!
what I mean, I have a warning sentense that I want to enable the use to dismiss it so it disappears without reloading the page!?
any help out there?
many thanks in advance!
Mo
Hi everyone!
I've been trying to find a script that hides text!
what I mean, I have a warning sentense that I want to enable the use to dismiss it so it disappears without reloading the page!?
any help out there?
many thanks in advance!
Mo
That's not very clear, yet.
What is it warning? Is this a user-controlled thing, or will it check something (if there is a plugin, if an image loaded, etc.)?
You should be able to use javascript to change the CSS property of visibility to make it dissapear, though.
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:<span onclick="this.parentNode.removeChild(this);">Click here to remove this text!</span>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
That's nice. Easy, too.
Might be more fun with:(though you can do whatever you want, within that span)Code:<span style="background-color: #FFFF00;" onclick="this.parentNode.removeChild(this);">Click here to remove this text!</span>
Last edited by thetestingsite; 05-09-2007 at 01:47 AM. Reason: making the color an easier one to read
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
am afraid it's not working.
am getting the message "Click here to remove this text!" but plain text without a link, any suggestions? is there something you assume am writing before that?
One more thing, what about if I want to hide the text by clicking on one word not the entire thing, example:
This site has been updated ( dismiss )
here i want the user to be able to click on ( dismiss ) so the sentence before disappears
Many thanks for the help !!
The message is set with the onClick attribute, so it should dissapear. It works for me, anyway.
It won't seem to be a link, though you could format it as such (underline, cursor: hand;, etc.), or make it a link to "#", etc.
As for (dismiss), that might be harder.
I'm guessing, on the span tag, then, use:
onclick="this.parentNode.parentNode.removeChild(this);"
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
HTML Code:<a href="#" onclick="this.parentNode.removeChild(this);">Click here to remove this text!</a>
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
Many thanks, problem solved!
cheers, Moh
Or the following one
Code:<span onclick="this.parentNode.removeChild(this);" style="text-decoration:underline;" onmouseover="this.style.cursor='hand';this.style.cursor='pointer';">Click here to remove this text!</span>
codeexploiter's is preferable... it's not a link, so using <a> is an abuse of the element, and may confuse people without Javascript.Not quite...onclick="this.parentNode.parentNode.removeChild(this);"Code:<p> Some text ( <span onclick="this.parentNode.parentNode.removeChild(this.parentNode);"> dismiss </span> ) </p>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks