0

This is my iframe code

    <iframe src="http://myurl.com" opacity="0" scrolling="no" margin-top="10px" marginwidth="0" marginheight="0" align="middle" frameborder="0" width="100%" height="215px"></iframe>

I just want to use two different iframe heights for Desktop and Mobile Devices. For e.g. For Desktop Devices iframe height shoule be 215px For Mobile Devices (Android, Iphone, Ipad) iframe height shoule be 415px

How can i do this from Jquery ?

Rick Bronger
  • 310
  • 1
  • 14
Ashu
  • 21
  • 4

1 Answers1

0

Set it with CSS and use CSS Media Queries to determine screen width and set styles according to that.

iframe { height: 300px }

@media only screen and (max-width: 800px) { 
  iframe { height: 500px }
}
Zonf
  • 67
  • 1
  • 8