mercredi 23 août 2017

Want to run only one if Condition

What if my " screen width < 1200 " then only this " alert('1200') " alert show and when my screen width < 640 then only this " alert('640') " alert show.

Fiddle

if ($(window).width() < 1200) {
        alert('1200');
}
if ($(window).width() < 640) {
  alert('640');
}
<script src="http://ift.tt/1oMJErh"></script>

Aucun commentaire:

Enregistrer un commentaire