1

I'm trying to change the visibility of a div based on a jQuery .click of a checkbox input.

I've been working on fixing an issue with a Full Screen CSS Nav. This is the modified CodePen: http://codepen.io/tedrem/pen/OVbYde

Visibility Toggle:

$.fn.toggleVisibility= function() {
var $this  = $(this);
if($this.css("visibility")=="hidden"){
    $this.css("visibility","visible")
}else{
    $this.css("visibility","hidden")
}
return this;
};

Checkbox Click to Initiate the Function:

$(".checkbox-toggle").click(function (){
   $("#links").toggleVisibility();
})

Relevant HTML Lines: 3 & 7
Relevant CSS Lines: 123

NOTE: This is currently not working. The div remains hidden

2
  • Your codepen doesn't include jquery, so it's throwing an error: Uncaught ReferenceError: $ is not defined. I added jQuery and it works fine. Commented May 28, 2015 at 3:21
  • @T3D Could you define more clearly, what you want? I mean you want is that the menu links(About,Products,Blog,Contact) to display on click menu icon? Commented May 28, 2015 at 3:27

1 Answer 1

1

Based on your example (on the link), Just remove Line 123 on your CSS and it will be fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.