Collapse on Desktop, View on Mobile

Hi,

I am able to show an image on the mobile site that is hidden on the desktop, but I am unable to collapse and hide the image on desktop and then view on mobile.

Any thoughts?

Best,

Felix

Hi,
you can use navigator.userAgent or resolution to create a function that detects if its a mobile device.
Then, in your page’s code, just use $w(“#YOUR_IMAGE_ID”).hide() if it’s not mobile. (replace YOUR_IMAGE_ID with real id)
don’t forget to do that only when site is ready ( inside $w.onReady() )