We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

hide function not working | Forum

Corey
Corey Dec 13 '15

I'm trying to make a button that will disappear after being clicked. I've gotten it to work on another site(not oxwall powered), but cannot get it working on oxwall. Can anyone help me out? I'd really appreciate it. Heres the code below:-


<button class="gift-2"><img src="http://kikcommunity.com/...s/theme_image_24.png" /></button>


<script>$(document).ready(function () { $("button").click(function handleClick() { { $(this).off('click'); alert('You have received your daily gift. Come back again tomorrow to get another. Merry Christmas!');} var $this = $(this); if ($this.is(".gift-1")) { $.cookie("button1", 1, { expires: 1 }); $this.prop("disabled", true); } else { $.cookie("button2", 1, { expires: 1 }); $this.hide(); } });
if ($.cookie("button1")) { $(".gift-1").prop("disabled", true); } if ($.cookie("button2")) { $(".gift-2").hide(); }});</script>

ross Team
ross Dec 13 '15
Topic was moved from General Questions.