How to fit the image properly in div

Published on

Way to fit the image properly in div. Use the below Javascript for re-size the image: window.imagefit = function (img){ var width = img.naturalWidth; var logoHeight = img.naturalHeight; var ans = calculateAspectRatioFit(width, logoHeight, img.clientWidth, img.clientHeight); img.style.height = ans.height+’px’; img.style.width = ans.width+’px’; } function calculateAspectRatioFit(srcWidth, srcHeight, maxWidth, maxHeight) { var ratio = Math.min(maxWidth / srcWidth, maxHeight … Continue reading How to fit the image properly in div

solution for window.open scrollbars=no not working in chrome

Published on

window.open scrollbars=no not working in chrome I have a link that opens a popup window using¬†window.open(). The problem is the scrollbars=no don’t work in Chrome. They work in IE and Firefox, so I’m thinking it has something to do with Chromes new scroll bars. This is ¬†the code I’m using: html: <a href=”http://mypage.com/mypage.html”>Mypage</a> jQuery: $(‘a’).click(function() … Continue reading solution for window.open scrollbars=no not working in chrome