How to set iframe fixed in Raw Html?
This is my web: http://phut90.vn/livescore#inscore_ifheight_xdc_4006
the frame was be broken size when i zoom in or views on phone, Tablet.
Thanks
1.
( “<iframe id=”inscore-xdc-178218″ src=”http://www.livescore.in/vn/free/178218/” width=”790″ height=”500″ frameborder=”0″ scrolling=”no”></iframe>
<script type=”text/javascript”>/*<![CDATA[*/try{function inscore_178218_xdc(){this.elm = null;this.hash = null;var times_resized = 0;var times_not_resized = 0;this.resize = function(){times_resized == 1023 && (times_resized = 0);times_not_resized == 1023 && (times_not_resized = 0);if(this.getElm() && location.hash && location.hash != this.hash){this.hash = location.hash;var reggg = new RegExp(“.*inscore_ifheight_xdc_([0-9]{2,5}).*”);if(result=reggg.exec(location.hash)){this.getElm().style.height = (typeof result[1] == “undefined” ? “10000”:(result[1] > 500 && result[1] <= 30000 ? parseInt(result[1]):500)) + “px”;times_resized ++;}} else if(location.hash && location.hash == this.hash) times_not_resized ++;else return resize_later(75);resize_later(250);};var resize_later = function(time){setTimeout(function(){ inscore_178218_xdc_run.resize(); }, time);};this.getElm = function(){try {(typeof this.elm == “undefined” || this.elm === null || !this.elm) && (this.elm = document.getElementById(“inscore-xdc-178218”));} catch(e) { this.elm = null; }return this.elm;};var show_links = function(){if((times_resized >= 1 || times_not_resized >= 2) && (obj = document.getElementById(“freescore_links_178218”))){obj.style.visibility = “visible”;obj.style.display = “block”;} else show_links_later();};var show_links_later = function() { setTimeout(function(){ show_links(); }, 100); };if (typeof window.postMessage == “undefined”){show_links_later();resize_later();}else{var ev = function(event){try{var data = JSON.parse(event.data);}catch (e){return;}if (data instanceof Array && data[0] == 178218 && typeof data[1] != “undefined”){eval(data[1]);}};if (window.addEventListener){window.addEventListener( “message”, ev);}else if ( window.attachEvent ) {window.attachEvent(“onmessage”, ev);}setTimeout(function(){ document.getElementById(“inscore-xdc-178218”).contentWindow.postMessage(JSON.stringify([“178218”, “run”]), “*”); }, 2000);show_links_later();resize_later();}};var inscore_178218_xdc_run = new inscore_178218_xdc();}catch(e){document.getElementById(“inscore-xdc-178218”).style.height = “10000px”;}
/*]]>*/</script> )
2.
( <iframe src=”http://www.tablesleague.com/iframe?width=700&height=469&font_name=Verdana&position=1&font_size=14&team_link=0&link_color=404040&games=1&wins=1&draws=1&lost=1&goals=1&goals_against=1&gd=1&points=1&next=1&form=1&font_size=14&font_color=000000&bg_color=FFFFFF&header_font_color=FFFFFF&header_bg_color=1fb9e4&bg_col=1fb9e4&font_color_col=FFFFFF&highlight=e3e3e3&hover=8cd214&league_header=0&league=l_145&team=&timezone=7&language=2&team_flags=0″ width=”700″ height=469 frameborder=”0″ scrolling=”no”></iframe> )
Hello,
Unfortunately your iframe was not made to be responsive: http://screencast.com/t/a9yn4dRtweq – http://screencast.com/t/xRsgIbpcn5Su
If a fixed width is specified, it will stay fixed on mobile as well. You will have to make the change at your end because an iframe cannot be targeted with custom css. You will have to change the code for the iframe and set the width to percentage instead of fixed. You can use a width of 100%, then it will become responsive.
Thank you!