iframe

iFrame Hide Scroll bars but still be able to scroll with mouse wheel

谁说胖子不能爱 提交于 2019-12-19 04:14:34
问题 What I am trying to do is make an iPhone simulator and just have a web page display in an iFrame. The scrollbars are taking up too much room so I want to hide them but still have the ability to scroll. Here is the HTML: <div id="iphone"> <iframe src="http://site.com" width="307" height="443"><p>Your Browser does not support iFrames.</p></iframe> </div> CSS: #iphone { background:url(iPhone.png) no-repeat; width:368px; height:706px; position:relative; overflow:hidden; } #iphone iframe {

Chrome: Getting iFrame and inserting into body

雨燕双飞 提交于 2019-12-19 04:09:35
问题 I've got the following code which works fine in Firefox... if (!iFrame) iFrame = outerDoc.getElementById('_dialog_iframe'); var iFrameDoc = iFrame.contentWindow.document; // get iframe doc and the Chrome version... if (!iFrame) iFrame = outerDoc.getElementById('_dialog_iframe'); var iFrameDoc = iFrame.document; // get iframe doc I'm testing the code be getting iFrameDoc.body when I run the FireFox code in Firefox it works fine. However, the Chrome code returns undefined . Why? How do I fix

iframe+form表单提交数据

ぐ巨炮叔叔 提交于 2019-12-19 03:57:35
<h6>基于iframe+Form表单</h6> <iframe id="iframe" name="ifra" onclick="AjaxSubmit5()"></iframe> <form id="fm" action="/app04/ajax1/" method="POST" target="ifra"> <input name="root" value="111111"/> <a onclick="AjaxSubmit5()">提交</a> </form> 通过form的target 与iframe的name进行关联 function AjaxSubmit5() { //提交之前绑定 document.getElementById('iframe').onload=reload; document.getElementById('fm').submit() } function reload() {//提交之后取值 //用jQuery找 // console.log($(ths).contents().find('body').html()) var content = this.contentWindow.document.body.innerHTML;//this代表iframe标签 var obj=JSON.parse(content);//转换成json对象 }

change iframe content jquery

不羁岁月 提交于 2019-12-19 03:56:45
问题 I'd like to change my iframe content but I don't understand how <html> <head> <title>test</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> </head> <body> <iframe id="frame" width="100%" height="95%" src="http://google.com"></iframe> <script type=text/javascript > $('#frame').contents().find( "body" ).html('<p>hi</p>') </script> </body> </html> With this code I always have my google page and not a ifram with hi 回答1: <script type="text/javascript"

Detecting onload event in IE for iFrame which has PDF

徘徊边缘 提交于 2019-12-19 03:56:30
问题 I see that this question has been asked many times here. Some of the solutions partially work. This is the scenario. I need to load an iframe which has a pdf using <embed> . There are chances the PDF is not found and I will be showing error page within iFrame. Once the iframe is loaded, I look for <embed> tag using $('#iframe').contents().find('embed') I tried using $('#iframe').load() . This works in Firefox, Chrome but not IE. Also tried using $('#iframe').ready() . This works in IE,

disallow window open in javascript

蹲街弑〆低调 提交于 2019-12-19 03:25:31
问题 How can I disable window.open() using html, javascript, jQuery...? I mean block any window open attempt, making "not-working" all existing window.open() functions. Which are the best ways to do it? (working also in case of iframes) 回答1: //for iframes: $.each($('iframe'), function() { this.contentWindow.open = function (url, windowName, windowFeatures) { //iframe window.open caught! }; }); //for window: window.open = function (url, windowName, windowFeatures) { //window.open caught! }; 回答2:

Drag and drop cross domains, iframes, browsers windows

℡╲_俬逩灬. 提交于 2019-12-19 03:13:39
问题 Thanks stackoverflow i solved a lot of my javascript problems, but now i stopped at the point without hope. It is hard to describe, there is clear video shows my problem with drag drop cross-domains iframe. http://www.youtube.com/watch?v=v65mO27h75E First part in Iceweasel (and FF, Opera) = iframe d&d work OK. Second part in Chromium (and Chrome) = iframe d&d NOT work. and there are links to example iframes set and iframes sources: parent page: http:// msdrop.com/msdrop-jquery-test-iframe

Drag and drop cross domains, iframes, browsers windows

陌路散爱 提交于 2019-12-19 03:13:02
问题 Thanks stackoverflow i solved a lot of my javascript problems, but now i stopped at the point without hope. It is hard to describe, there is clear video shows my problem with drag drop cross-domains iframe. http://www.youtube.com/watch?v=v65mO27h75E First part in Iceweasel (and FF, Opera) = iframe d&d work OK. Second part in Chromium (and Chrome) = iframe d&d NOT work. and there are links to example iframes set and iframes sources: parent page: http:// msdrop.com/msdrop-jquery-test-iframe

How to call parent window function in chrome browser?

余生颓废 提交于 2019-12-19 03:12:08
问题 HI, I've surprisingly found problems, in Chrome browser, in calling window parent javascript functions. If I have a window with a javascript function defined in it <script type="text/javascript"> function dolink() { . . . } </script> and I have an iframe inside that window that makes this call using jquery <script type="text/javascript"> $(function() { $('a.arglink').click(function() { window.parent.dolink($(this).attr('href')); return false; }); }); </script> the call to dolink function

iframe with a css fixed position : possible?

你离开我真会死。 提交于 2019-12-19 02:06:15
问题 I would like to add some ads on an external website, to do so, I use iframe : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body style="background:#ddd"> <center>My ad</center> <iframe src="http://www.google.com" style="position:fixed; top:50px; left:0; width: 100%; bottom: 0; border: 0 "> <p>Your browser does not support iframes.</p> </iframe> </body> </html> The iframe is