Team:Grenoble/script
From 2012.igem.org
(Difference between revisions)
Line 104: | Line 104: | ||
function A(c,a,b){ | function A(c,a,b){ | ||
- | + | var d,e,f,j,k,l,i,g,h; | |
- | + | b=b||{}; | |
- | + | d=b.max_w; | |
- | + | e=b.min_w; | |
- | + | f=b.max_h; | |
- | + | j=b.max_h; | |
- | + | k=b.round===undefined?1:b.round; | |
- | + | l=c/a; | |
- | + | i=a/c; | |
- | + | g=a; | |
- | + | h=c; | |
- | + | if(h<e){ | |
- | + | h=e; | |
- | + | g=h*i | |
- | + | } | |
- | + | if(g<j){ | |
- | + | g=j; | |
- | + | h=g*l | |
- | + | } | |
- | + | if(h>d){ | |
- | + | h=d; | |
- | + | g=h*i | |
- | + | } | |
- | + | ||
- | + | h=h<0?0:h; | |
- | + | g=g<0?0:g; | |
+ | return{w:k?Math.round(h):h,h:k?Math.round(g):g} | ||
+ | } | ||
+ | |||
}) | }) | ||
(window,document); | (window,document); | ||
+ | alert("coucou"); | ||
+ | alert("coucou"); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 09:56, 12 July 2012