javascript - return a value via function math result that is stored in a variable -


i trying result of browsers window width , trying put result of math , condition in variable , code

var mywidth = 1900; var myheight = 900; var height = $(window).height(); var width = $(window).width();  var autow = function () {     if ( (mywidth / width).tofixed(2) > 0.95 )           return 1;     if ( (mywidth / width).tofixed(2) < 1.05 )           return 1;     else return (mywidth / width).tofixed(2);      };   alert(autow); 

the problem don't know right syntax or structure of function assigned variable

what right way code ?

alert(autow());

autow() returns value of function assigned variable.

fiddle : http://jsfiddle.net/v2esf/


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -