• André

    (@dasgelbevomei)


    Hi guys,

    I found a code snippet in this post to hide the content of a table on mobile device.

    (function() {
        if (window.innerWidth <= 768) {
            var handle = function() {
                var els = document.getElementsByClassName('lwptoc_toggle_label');
                for (var i = 0, l = els.length; i < l; ++i) {
                    els[i].click();
                }
            };
            if (document.readyState === 'loading') {
                document.addEventListener('DOMContentLoaded', handle);
            } else {
                handle();
            }
        }
    })();

    Unfortunately I seems not to work anymore and the other post is closed. I would appreciate any help!

    Cheers,
    André

    • This topic was modified 2 years, 6 months ago by André.
    • This topic was modified 2 years, 6 months ago by André.
Viewing 1 replies (of 1 total)
  • You can use CSS to hide it on mobile:

    @media only screen and (max-width: 768px) and (min-width: 0) {
    	.lwptoc { display: none; }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Hide content on mobile’ is closed to new replies.