I am making a page that uses buttons to display the content when the creen is wider than 500px, and then it moves to an 'accordion' style layout when the screen is smaller than 500px.
I am using event listeners and match media along with an if/else…
Good day!
Found a script on the network to determine the screen size, but I can not figure out how to correctly set the definition isMobile, isTablet, isDesktop.
function() {
var i = {
mobile: "mobile",
tablet: "tablet",
…
I created this function to handle the toggle for my mobile nav.
const mobileNav = document.getElementById('mobile-nav');
let tabs = document.getElementsByClassName('nav_tabs');
//nav toggle control
mobileNav.onclick = (event) => {
…
I am working with window.matchMedia(), and I cannot seem to get the function to apply a secondary class when a max or min width is reached. I've recreated the problem below with a simple font-size change.
I've read up on matchMedia() and I've…
I have been playing with phantomJS for a while and I came across problems when using it in websites that use matchMedia queries to distinguish device types.
For a while I thought that was a phantom problem but it is happening with other headless…
have a fixed vertical dot navigation that fades in when the user scrolls to a certain section on the site so that they can see how many sections there are past that point and can navigate accordingly. If the user then scrolls back up past that point…
I'm trying to trigger my fancybox for viewports >=768px and trigger my swipebox for viewports <768px.
Unfortunately neither one opens now... what am I missing?
Thanks for your help!
I have tons of CSS thus I'm just adding the JS (I'm quite sure it's…
Can someone please help and explain why the following code doesn't work? I can't seem to figure out why... to me, everything should be working.
jQuery(window).load(function($){
if (window.matchMedia("(min-width: 768px)").matches) {
var…