Dongzhuoer (Talk | contribs) (Created page with " var debug = true; var igem = document.location.href.includes('https://2016.igem.org/'); //element is $(<img>), which is 100% embed in its parent. So aut...") |
Dongzhuoer (Talk | contribs) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | var rem = Number($('html').css('font-size').replace('px', '')); | |
− | + | function log(value) { console.log(value); } | |
− | + | function particles() { $('#particles-js').toggle(); } | |
− | + | function adjust_figure(scale) { | |
− | + | $('figure').each( | |
− | + | function (index, value) { | |
− | + | var max_width = $(value).find('span').width() / rem * scale + 'rem'; | |
− | + | $(value).css('max-width', max_width); | |
− | + | } | |
− | + | ) | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } |
Latest revision as of 16:16, 19 October 2016
var rem = Number($('html').css('font-size').replace('px', ));
function log(value) { console.log(value); } function particles() { $('#particles-js').toggle(); } function adjust_figure(scale) { $('figure').each( function (index, value) { var max_width = $(value).find('span').width() / rem * scale + 'rem'; $(value).css('max-width', max_width); } ) }