Hello, everyone. I am a newcomer to this site, and I have just learned programming. Now I encounter a front-end problem, so I send a post for help, hoping that there is a great god to guide me.
I found a single page template on the Internet and wanted to put it on our website. This template has two views: list view and grid view , which is the grid view by default. There is no problem with viewing on the computer side, but it is ugly to huddle together when viewing on the mobile side.
template link: https://bootsnipp.com/snippet.
I want to show only the list view when viewing on a mobile device, so I add the judgment code to JS as follows:
if (screen.width <= 819) {
$(document).ready(function() {
$("-sharplist").ready(function(event){event.preventDefault();$("-sharpproducts .item").addClass("list-group-item");});
});
}
but did not solve the problem: (
I hope the master can give me some advice. Thank you very much!