Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
How Create an event handler for event "resize"?

when alternating the display on the browser (F12) from mobile or responsive to desktop the div (content_filter) disappears.. refresh the page to fix the bug.

Desktop view

Desktop mode

from what I understand I need to add a Window: resize event to avoid refreshing each time. my level in javascript is completely beginner. can you show me the correct technique with my code?

<script>

        document.addEventListener('DOMContentLoaded', function () {
            jQuery(function ($) {

                $('.filter_btn').click(function (event) {
                    if (window.innerWidth <= 768) {
                        $('.content_filter').slideToggle('250', 'swing', 'hide');
                    }
                });
            });
        });
    </script>

    <style >
        @media all and(max - width: 768 px) {
            .content_filter {
                display: none;
            }
        } 
</style>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use:

window.addEventListener('resize', function () {
console.log(window.innerHeight);
});

check https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event for further informaion.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!