Write a simple width/height jQuery script

  • Status Completed
  • Budget $2 - $15 USD / hour
  • Total Bids 5

Project Description

I need a very simple jQuery script that does the following:

1) Get width and height of window using something like: $ (document). ready(function () { showWidth(".pre_banner", $(window).width()); });

2) Looks for these break points. and store the corresponding width and height as variables.

If window is larger than 1400px wide, width = 600px, height = 400px;

If window is 1000px to 1399px wide, width = 500px, height = 300px;

etc. I will define all the sizes, you just need to make sure I can add more easily

3) Display this image where the 1st variable (width) and 2nd variable (height) are the variables from #2

[url removed, login to view],400

As the window size changes so should the width/height variables of the image, reloading the src with the proper ending when needed.

I know javascript may be slightly faster but please use jQuery.

Get free quotes for a project like this
Completed by:

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online