jquery - Width event only for tablet -


testing website facing little issue (not important, appreciate if has solution):

i using following code redirect users mobile version , deleting data-attribute. code:

if (screen.width <= 480) {     document.location = "/mov/index.php"; }    if ((navigator.useragent.match(/iphone/i)) || (navigator.useragent.match(/ipod/i))) {     location.replace("/mov/index.php"); } if ($(window).width() > 1023) {     $('#content').attr('data-snap-ignore', 'false'); } else {     $('#content').removeattr('data-snap-ignore'); } 

the first part not main problem, focusing on following event, there goes question:

if ($(window).width() > 1023) {     $('#content').attr('data-snap-ignore', 'false'); } else {     $('#content').removeattr('data-snap-ignore'); } 

how set width event tablets?

also thought user agent, seems trouble android tablets (since mobile , tablets have got same user agent).

you this:

$('#yourtableselector').width()  

but need add resize event if want work when resizing window.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -