Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

hilary ledoan
hilary ledoan
3,533 Points

How do I not load a div only on mobile, not desktop? I want to add this slider http://excolo.github.io/Excolo-Sl

Is there a js that can do this? I do not want to 'display: none', bc that will slow down the site. the excolo slider is on jquery, and I'm not sure how to modify it to only load on mobile. Is there a js/jquery to do this?

1 Answer

Here's a stackoverflow thread on it:

http://stackoverflow.com/questions/11381673/detecting-a-mobile-browser

Probably you've got to choose the best option based on what 'mobile' means in the context of your site (screen size or type of human interface).