简体   繁体   中英

media queries and javascript clash

I want an element to be always displayed in desktop view and toggle-able in mobile view.

If user hides the element with javascript in mobile view and then resizes to desktop view it remains hidden (due to the javascript setting).

Is there any way to force it to stay visible in desktop view regardless of any javascript hiding?

Or do I need to define the element twice, once for mobile once for desktop?

使用JavaScript来应用通过CSS隐藏元素的类,而不是直接隐藏元素。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM