DEV Community

Discussion on: Responsive Image Gallery like Shutterstock, Pixabay and Adobe Stock using HTML CSS & JavaScript

Collapse
 
liluleni profile image
Lilu

Cool script, worked fine on the browsers on desktop PC. Thank you! Unfortunately, the script doesn't work for me on mobile iOS 15.6 (all Browsers, Firefox, Safari, Chrome). Is it the same for you?

Collapse
 
krishna_soni profile image
Krishna Soni • Edited

I tested this site in my mobile it's working perfectly but I will try my best to solve your problem I need your little help run this code and check in your ios which is giving output
var a = document.getElementById("main").main.querySelectorAll('.img')[0].naturalWidth
var b = document.getElementById("main").main.querySelectorAll('.img')[0].offsetWidth
alert(a);
alert(b);
and tell me which js property not working

Collapse
 
liluleni profile image
Lilu

I changed your script in:
var a = document.getElementById("main").querySelectorAll('.img')[0].naturalWidth
var b = document.getElementById("main").querySelectorAll('.img')[0].offsetWidth
alert(a);
alert(b);

var a is not working

Thread Thread
 
krishna_soni profile image
Krishna Soni

that's mean naturalWidth property not work on ios 15.6