Answer the question
In order to leave comments, you need to log in
How to block script execution in responsive design?
The html page has pictures. When you click on an image, a script is executed that enlarges the image.
Through css and media for the page, there are several options. What is the easiest way to make sure that the script is not executed on the mobile version (i.e. the picture does not increase)?
Answer the question
In order to leave comments, you need to log in
Find this piece of code with the script and fulfill the condition
function windowSize(){
if($(window).width() >'768'){
<code>код</code>
// экран больше 768 px в ширину --- выполняем скрипт
}
}
$(window).load(windowSize);
$(window).resize(windowSize);
$(window).on('load resize',windowSize);
On the server, determine that this is a mobile version and do not give scripts for pictures.
Or
On the client, determine that this is a mobile version and do not run the script for pictures
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question