Here is my .js attempt
//it works great with the resize, but the text wraps if the input is too long
- $(document).ready(function () {
//set the originals
var originalWinHeight = $(window).height();
var originalWinWidth = $(window).width();
//set the original font size
var originalFontSize = getOriginalFontSize();
//set the ratio of change for each size change
var ratioOfChange = 50;
//set the font size using jquery
$("#Full").css("font-size", originalFontSize);
$(window).resize(function () {
//get the width and height as the window resizes
var winHeight = $(window).height();
var winWidth = $(window).width();
//get the difference in width
var widthDiff = winWidth - originalWinWidth;
//check if the window is larger or smaller than the original
if (widthDiff > 0) {
//our window is larger than the original so increase font size
var pixelsToIncrease = Math.round(widthDiff / ratioOfChange);
//calculate the new font size
var newFontSize = originalFontSize + pixelsToIncrease;
//set new font size
$("#Full").css("font-size", newFontSize);
}
else {
//our window is smaller than the original so decrease font size
var pixelsToDecrease = Math.round(Math.abs(widthDiff) / ratioOfChange);
//calculate the new font size
var newFontSize = originalFontSize - pixelsToDecrease;
//set the new font size
$("#Full").css("font-size", newFontSize);
}
})
});
getOriginalFontSize = function () {
var windowWidth = $(window).width();
var thisFontSize = windowWidth / 50;
if (thisFontSize > "16") { thisFontSize = "16"; }
return thisFontSize;
}
I have messed with the css property white-space:nowrap;, That stops wrapping, but simply overruns, rather than shrink down. Any help you have would be appreciated.