VideoHive

Change Style On Browser Size

359 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
jjjrmy says

Hey guys, I need a little help. I have a huge image on my site, currently I have a link that saves a cookie that disables the image if users want to, but I am still getting complaints about the image from people with smaller monitors.

I was wondering if anyone had a script or could help with one that change the style of the image to “display: none;” if the width of the window was of x amount.

I looked on Snipplr, but the one code I did find sorta confused me, and it was only for changing style sheets, and not just a style itself.

497 posts
  • Canada
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Exclusive Author
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
TutelageSystems says

Are you using jQuery?

You could use the Resize API to easily change the style of the object by either using addClass and removeClass.

You can even try using the CSS method to change your display from (block/inline) to none.

by
by
by
by
by