Resize function with bootstrap

Hi,
I am pretty new to jQuery, a requirement has come up to make things as such. When my page is in mobile, it should add this functionality to a div, what makes it difficult for me to run it, is the fact

  1. Window resize doesn’t work while testing in browser testing
  2. That the click function isn’t working
  3. How can i go back to first step i.e toggle it back it was i.e hidden, and ready to run function again, is someone again tries to open it back?

I might be crappy on jQuery but, i am learning and sometimes the demand is more than i have supply :smile:

Use media queries instead of checking size in jQuery.

@media (max-width: 768px) {
    .para-2 > p {
        display: none;
    }
}

But the reason it’s not working, is because you’re looking for (document).width() instead of $(document).width(), where $ is a reference to jQuery.

You will run into a problem with not resetting the .para-2 > p back to visible when the width is greater than 768.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.