Hi
Here's the page in question: http://cargocollective.com/amytdatta/Amyt-Datta
At the bottom of the page is the block of text in question. What i'd like to do is have an easter egg link which when clicked hides all the text which is false leaving only the truth. Any advice?
I'm sorry if this is painfully simple! I'm a complete n00b.
Thanks,
Jiver
Wow thanks so much! I really appreciate it.
BTW, there seems to be some problem with the forums on my browser (Safari 5) I can only see the last comment (Christopher Burton's). The rest of the entry is a gray blank. Or is this a browser settings issue?
Cheers! Also, is there a way to script this so that the false statements merely become the background colour, or get a strikethrough, etc rather than collapsing completely? I'd like to keep the overall structure of my text the same rather than it becoming a smaller block.
Where do I put that code? In the site HTML? And what do I use for the a href?
hashtag or a blank target just takes me back to the Cargo Collective homepage.
Hi Here's the page in question: http://cargocollective.com/amytdatta/Amyt-Datta At the bottom of the page is the block of text in question. What i'd like to do is have an easter egg link which when clicked hides all the text which is false leaving only the truth. Any advice? I'm sorry if this is painfully simple! I'm a complete n00b. Thanks, Jiver
@thejive I would add a class to the text that is false and use jQuery to hide it with a click function of the bold text.
Digs disco
<span class="false">Was born in the 70s</span>Grew up in a vicious part of town
Reads mathematics textbooks to relax
Begins the day with a hundred push-ups
Was attacked by cockroaches after shooting a lizard
<span class="false">Is a vegetarian</span><span class="false">Was born in the 60s</span>Didn't use a computer until 2012
Is a completely self-taught musician
Often sleeps with his guitar next to him
Has played on a freezing stage lit by a single naked bulb`
<a class="showtrue" href="#">Only some of the above is true.</a>JQuery:
Wow thanks so much! I really appreciate it. BTW, there seems to be some problem with the forums on my browser (Safari 5) I can only see the last comment (Christopher Burton's). The rest of the entry is a gray blank. Or is this a browser settings issue?
@thejive See here: http://jsfiddle.net/gVU9A/
@thejive I see the code messed up. Here is the new jQuery code that should stop the redirecting.
http://jsfiddle.net/xAQDE/
Thanks so much! Any idea why I can only see the last comment in this thread (and indeed every thread on the forum)?
@thejive Probably a browser issue. I'll notify @chriscoyier about this.
Cheers! Also, is there a way to script this so that the false statements merely become the background colour, or get a strikethrough, etc rather than collapsing completely? I'd like to keep the overall structure of my text the same rather than it becoming a smaller block.
@thejive Sure. Just tell me what exactly you want it to look like.
Well let's just say I want the false text to turn white.
@thejive Try this:
Very sick, man! Thank you.
My pleasure. If you need further help, I'll be around later or someone else might answer your questions. It's 1am here and I'm off to bed.
@thejive All right. Let's try this one more time.
Remember you need to wrap the text that is false with some sort of markup.
@thejive You're still using
href="#"You should be using
href="javascript:void(0)"Done! I'm having to copy your replies into TextEdit to read them haha! Thanks!
Instead of the href="javascript:void(0)" since its icky and shows when people hover the link you should just use
example:
Where do I put that code? In the site HTML? And what do I use for the a href? hashtag or a blank target just takes me back to the Cargo Collective homepage.
Woah this forum is really strange. Now my post just formatted in a weird way (at least on my screen).
@thejive put that code just below your last jQuery code.
I've edited it...the forum works oddly if you use a #hashtag
At least sometimes :)
I think the issue is because of the base href but you can't remove that as it might effect other things.
I'm probably going to be banned for going on and on about this. But i'm STILL at a loss! I've summarised my attempts everything here: http://support.cargocollective.com/customer/portal/questions/580760-jquery-script-implementation
Sorry, i noticed it too late that "return false" was already in one of the examples/replies before mine!
@thejive Try asking this question on http://stackoverflow.com if no one else here can help.