Can I Force Iframe To Show Certain Part Of Page Using Css Or Jquery
I want to show video from one of the website since i cant consume it i though of using iframe and some how show only video part of the iframe.
Solution 2:
You can easily do it on the condition that the page (coming from another domain) you show is sent with CORS headers allowing your origin (or any origin).
var httpRequest = newXMLHttpRequest();
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === 4) {
if (httpRequest.status === 200) {
$content = $(httpRequest.responseText);
$(iframeId).html($content.find('.floatFirst.omega_t3'));
}
}
}
httpRequest.open('GET', 'http://www.dmi.ae/live.asp?lang=en&ChannelID=2');
httpRequest.send();
For more information about how to set CORS headers, see http://enable-cors.org/
Solution 3:
While it's not an ideal solution...
I had a play and came up with this: http://jsfiddle.net/XrdRH/ it still needs a little refinement with getting the distances right and all but all that's required to change it is changing the offsets.
top:-303px; left: 10px;
The entire code used is (required to submit):
<iframesrc="http://www.dmi.ae/live.asp?lang=en&ChannelID=2"width="680"height="855"style="position:absolute; top:-303px; left: 10px; overflow: hidden;">
You should look to find a nicer solution, but this does just about work :)
Post a Comment for "Can I Force Iframe To Show Certain Part Of Page Using Css Or Jquery"