I hav been able to get most of the script workin all that remains is it the end variable for the IF .
Current script so far (function($){ $.fn.testwidth = function(){ var element = this; $(element).load(function(){ changeCss(); $(window).bind("resize", function(){ changeCss(); }); function changeCss(){ var box = $(".box"); var windowWidth = box.innerWidth(); var calculation = (windowWidth - 300) / 152; $(element).css({ "width" : answer, "height" : 800 }); }; }); }; })(jQuery); What i need help with is the var answer that will be IF calculation = 4 then answer = 600 else if calculation = 5 then answer = 700 and so on. if someone can help me with this it will be much appreciated even a possibility of some $$ Thanks dP