minmax.jsの使い方

max-widthやmin-widthを使えるようにするためのjs
minmax.jsの使い方。

まずはこちらからダウンロード。
http://www.doxdesk.com/software/js/minmax.html

『minmax.js』はIE8で見た場合エラーになってしまう。
ダウンロードしたファイルを修正する必要がある。
以下のページを参考にする。
http://www.plusmb.jp/2010/03/22/5303.html

//36行目を書き換える。これを
if (em.style.setExpression) {
    em.style.setExpression('width', 'minmax_checkFont()');
    document.body.insertBefore(em, document.body.firstChild);
}

//こちらに書き換える
if (em.style.setExpression) {
   try {
       em.style.setExpression('width', 'minmax_checkFont()');
       document.body.insertBefore(em, document.body.firstChild);
    }
    catch(err){} 
}

投稿者:

ayako0802

フロントエンドエンジニア