Home › Forums › JavaScript › Horizontal drag scrolling › Reply To: Horizontal drag scrolling
That would be the idea indeed. I haven’t found any advantage of matchMedia
over a $(window).width()
, it doesn’t make the code any shorter and if I’m not mistaken it will return dimensions that have the scrollbars included like with normal media queries. For me that’s a decisive drawback.
Thinking about it though, I’m not so sure an extra request (loading the script conditionally) is very necessary. A large script might make a difference but with this minor amount of code I’d just incorporate any queries inside it. Making the conditional loading dependent on resizing may overcomplicate as well.
No worries about any temporary URLs, it shouldn’t be a big deal when a link ends up being dead with all the pens here…
One question – is it also the complete figure
that isn’t draggable or possibly just everything that is inside a
?