This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WORDWRAP FOR JAVASCRIPT | |
function wordwrap(str, w, brk) { | |
let n = 0; | |
let m = w; | |
let r = ''; | |
while (n + w < str.length) { | |
r = r + str.slice(n,m) + brk; | |
n = n + w; | |
m = m + w; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RESPONSIVE WEB DESIGN WITH JAVASCRIPT | |
function Responsive() { | |
let widthMain = window.innerWidth; | |
let widthButton = Calculation( widthMain, 300, 900, 6, 12 ); | |
document.getElementById('button').style.width = widthButton + 'em'; | |
}; | |
// RESPONSIVE CALCULATION |