• When posting, please be aware that artistic nudity is still nudity and not allowed under RpNation rules. Please edit your pictures accordingly!

    Remember to credit artists when using work not your own.

Help help with on click

eclipsa

faerie sightings
okay so basically i'm making a cs and i want to click somewhere to hide the main image and reveal the cs underneath it. i did it where it went away, but i can't figure out how to get it back so i tried with a hover but if i use the hover i can't use my internal hover. i've tried looking at codes with a similar idea that have buttons but i cannot for the life of me figure out how to make the button work. can someone please help me?
 
I have this basic piece of code you should just be able to paste into yours, change the classes etc and it'll work for simply clicking something to hide something, and then clicking to show it again. (I assume that's what you're after).

Code:
[script class=heart]
    set like 0
[/script]

[script class=heart on=click]
    if (eq ${like} 0) (addClass like heart) (removeClass like heart)
    if (eq ${like} 1) (set like 0) (set like 1)
[/script]

(This was to make a heart turn from black to red when clicked on, and back to black when clicked on again - but you can use whatever classes in there to reveal/hide your divs).
 
I have this basic piece of code you should just be able to paste into yours, change the classes etc and it'll work for simply clicking something to hide something, and then clicking to show it again. (I assume that's what you're after).

Code:
[script class=like]
    set like 0
[/script]

[script class=heart on=click]
    if (eq ${like} 0) (addClass like heart) (removeClass like heart)
    if (eq ${like} 1) (set like 0) (set like 1)
[/script]

(This was to make a heart turn from black to red when clicked on, and back to black when clicked on again - but you can use whatever classes in there to reveal/hide your divs).
thank you!! i will try this and see if it works ❤
 
what does your code look like atm? specifically the [script] part !!
 

Users who are viewing this thread

Back
Top