Category : resize

I have such a code in JavaScript for resizing text. Can I somehow modify it to store the size in cookies instead of local storage? let fontSize = 16; if(localStorage.getItem(‘font-size’)){ fontSize = localStorage.getItem(‘font-size’); } document.querySelector(‘.font-zoom__item’).textContent = fontSize; document.body.style.fontSize = fontSize + ‘px’; document.getElementById(‘str_size_1’).onclick = () => { fontSize++; localStorage.setItem(‘font-size’, fontSize); document.querySelector(‘.font-zoom__item’).textContent = fontSize; document.body.style.fontSize = ..

Read more

this._size = { width: e.nativeEvent.layout.width, height: e.nativeEvent.layout.height } let imageWidth = width; let imageHeight = height; let imageRatio = width/height; let targetRatio = this._size.width / this._size.height; let scaleFactor = targetRatio > imageRatio ? this._size.height / imageHeight : this._size.width / imageWidth; let newWidth = imageWidth * scaleFactor; let newHeight = imageHeight * scaleFactor; let OldX = ..

Read more

I have a problem where in Firefox when the page is refreshed or loaded again onload="resizeIframe(this)" stops working. I think its because of the caching of the page. When you load the page in Firefox for the first time it is working. In Chrome it works properly. I tried to fix this with document.addEventListener("DOMContentLoaded", function() ..

Read more

I am trying to implement this Word Cloud and use it to showcase my skills in my online portfolio: https://github.com/prashant1rana/jQWCloud.git The HTML code: <div class="scaleable-wrapper"> <div class="skillcloud"></div> </div> CSS: .skillcloud{ max-width: 1000px; height: 478px; } JS: $(document).ready(function() { $(".skillcloud").jQWCloud({ // Only included a few of the words for the sake of conciseness words: [ {word: ..

Read more