Dongzhuoer (Talk | contribs) |
Dongzhuoer (Talk | contribs) |
||
Line 2: | Line 2: | ||
function log(value) { console.log(value); } | function log(value) { console.log(value); } | ||
function particles() { $('#particles-js').toggle(); } | function particles() { $('#particles-js').toggle(); } | ||
− | function adjust_figure() { | + | function adjust_figure(scale) { |
$('figure').each( | $('figure').each( | ||
function (index, value) { | function (index, value) { | ||
− | var max_width = $(value).find('span').width() / rem * | + | var max_width = $(value).find('span').width() / rem * scale + 'rem'; |
$(value).css('max-width', max_width); | $(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); } ) }