While loading an iframe on page the most difficult thing is to set it’s height to the height of the content of the iframe. I looked around the web and got the code. This is pure Javascript, doesn’t contain jQuery or any other libraries. Set these functions : function getDocHeight(doc) { doc = doc || document; var body = doc.body, html = doc.documentElement; var height = Math.... [READ MORE]
Posts marked with "event" in tags
Scroll Horizontally Without Scrollbar Using jQuery
To scroll horizontally with CSS is very annoying, because the whole page will move vertically and sometimes the Y axis will scroll. So I decided to use jQuery and it’s very simple. Only 237 characters which is only 2 lines. Here is the **jQuery **code with the div id #scrollho. jQuery $('#scrollho').on('mousewheel',function(e){ e.preventDefault(); scrollLeft=$('#scrollho').scrollLeft(); if(e.originalEvent.wheelDeltaY.toString().slice(0,1)=='-'){ $('#scrollho').scrollLeft(scrollLeft+100); }else{ $('#scrollho').scrollLeft(scrollLeft-100); } }); CSS #scrollho{ overflow:hidden; } Explanation The #scrollho div’s scrollbars are hidden with CSS.... [READ MORE]