MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
no edit summary
imported>Hb1290 |
imported>Hb1290 No edit summary |
||
| Line 320: | Line 320: | ||
/* End of mw.loader.using callback */ | /* End of mw.loader.using callback */ | ||
} ); | } ); | ||
// This method will resize elements that have a class name of "js-proportional-resize" by | |||
// changing the font-size (%) based on a viewing area width of 900px being the baseline, | |||
// i.e. 450px width=font size 50%, 900px width=font size 100%, 1800px width=font size 200%. | |||
function proportionalResize() { | |||
var EXPECTED_PAGE_WIDTH = 900.00; | |||
$('.js-proportonal-resize').each(function() { | |||
var fontSizeCss= (($(this).width() / EXPECTED_PAGE_WIDTH) * 100.00) + '%'; | |||
$(this).css("font-size", fontSizeCss); | |||
}); | |||
} | |||
$(document).ready(function(e) { | |||
$('img[usemap]').rwdImageMaps(); | |||
proportionalResize(); | |||
}); | |||
$(window).on('load', function() { | |||
// the main page carousel text boxes aren't being initialized to the | |||
// correct size on IE, so add a second resize post-DOM-ready | |||
proportionalResize(); | |||
}); | |||
$(window).resize(function(e) { | |||
proportionalResize(); | |||
}); | |||
/* DO NOT ADD CODE BELOW THIS LINE */ | /* DO NOT ADD CODE BELOW THIS LINE */ | ||