I am currently creating a responsive web design using media queries. For mobile devices I want to remove my JS slider and replace it with something else. I have looked at .remove()
and a few other things from the JQuery library, however these have to be implemented into the HTML and I cannot think of a work around from the css angle.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
You can also use jquery function addClass() and removeClass() or
removeAttr()
to fulfill your purpose.Example:
Or you can also use media query as follow :
Not a 100% sure what you mean. But I created a class "no-mobile" that I add to elements that should not be shown on mobile devices. In the media query I then set no-mobile to display: none;.
You can hide an element and show another depending on screen size using media query from
css
, this is from one of my live projects (I use this to show/hide icon)Do you need to remove them, or just hide them? If just hiding is okay, then you can combine media queries with
display:none
: