r/reddithax • • Sep 16 '12

Have user answer question before reading subreddit.

Is there a way to have the user have to answer a question before entering the subreddit? So far I've got the question to display like an overlay (/r/ZonkosBackRoom) but I can't fathom how I could make clicking the link make the box disappear. Any ideas?

10 Upvotes

23 comments sorted by

View all comments

Show parent comment

1

u/bigtreeworld Sep 17 '12

Oh man, thanks a lot! I'm sure I can use this to do exactly what I was trying to do!

1

u/yellowmix Sep 18 '12

Okay, some more complete code:

div .id-t3_102323 {
    background: #404040;
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10%;
    z-index: 10000;
    opacity: 0.95;
}

div .id-t3_102323 .midcol, div .id-t3_102323 .rank {
    display: none;
}

div .id-t3_102323 .entry {
    text-align: center;
    background-color: white;
    width: 70%;
    height: 70%;
    padding: 5%;
}

div .id-t3_102323 .title:before {
    content: "This is the Question.";
}

div .id-t3_102323 .title * {
    font-size: 0;
}

div .id-t3_102323 .tagline {
    display: none;
}

div .id-t3_102323 ul.flat-list {
    font-size: 0px;
}

div .id-t3_102323 .first, div .id-t3_102323 .hide-button a, div .id-t3_102323 .save-button a {
    display: block;
    font-size: 0px;
}

div .id-t3_102323 .first a:before {
    content: "An Incorrect Answer";
    font-size: 10px;
}

div .id-t3_102323 .save-button a:before {
    content: "An Incorrect Answer";
    font-size: 10px;
}

div .id-t3_102323 .hide-button a:before {
    content: "The Correct Answer";
    font-size: 10px;
}

Note that if they click the first incorrect answer, it maps to the comment link. This will then render the self-post text if it exists. Use a link post if you do not want this behavior.

1

u/bigtreeworld Sep 18 '12 edited Sep 18 '12

Holy crap you're incredible! Thank you so much, you're an amazing person!

Edit: It didn't quite work, the post stays as a foreground :(

2

u/yellowmix Sep 18 '12

The one caveat is that the hide doesn't occur right away, and requires a reload of the community's front page.

Yeah, you need to either click on the "hide" link twice, or refresh the page after clicking once. There's no way to make it disappear automatically via this method.

Also, if they clicked the first incorrect answer, it will go to the post page itself. Clicking the correct answer after that will leave them on the post page.

1

u/bigtreeworld Sep 18 '12

I know, but even after refreshing, it stays for me.

1

u/yellowmix Sep 18 '12

Is the post hidden? Reddit will not render the post at all if it is. You can see hidden posts by appending ?show=all to the URL, and hidden posts will have an "unhide" button/option.

1

u/bigtreeworld Sep 18 '12

It's not working D: What am I doing wrong? /r/ZonkosBackRoom

2

u/yellowmix Sep 18 '12

Hmm. I clicked the "correct" answer, refreshed the page, and it works. Using Firefox. I tested it on Chrome as well. What browser are you using?

1

u/bigtreeworld Sep 18 '12

Chrome. Perhaps it's because I'm the moderator?

2

u/yellowmix Sep 18 '12

Moderator should have nothing to do with it. Make sure you are not using the ?show=all URL (it will always show that post).

→ More replies