jquery - Changing Background Image on Change in Device Width -
i have full screen background image. problem face gets chopped when viewing website mobile handset.
what have focus object getting viewed in mobile. have cropped image mobile dimensions of focus object. code detect mobile device , change background:url();
normal image if device tablet or desktop cropped version of image if smartphone being used. unaware how might take place. know jquery , @media rules me.
with media object check if current screen size bigger 768. if #bg values overwritten.
#bg { background-image: url('small.jpg'); } @media (min-width: 768px) { #bg { background-image: url('big.jpg'); } }
Comments
Post a Comment