iframe

How to make unwanted white space shrink in webpage?

佐手、 提交于 2019-12-13 06:27:16
问题 I have a page contains two vertically divs. First div contains iframe holder and the second random contents. The iframe can be less or more in height (has dynamic height). The problem when the iframe holder decrease in height, that causes unwanted white space between the iframe holder and the second div below it. This problem occurs in chrome only, IE & FF are working fine. How can I make this white space shrinks when the iframe decrease in height? Here is my page The iframe holder div

iframe auto size based on content that changes size based on search results

泄露秘密 提交于 2019-12-13 06:20:02
问题 I have one page that contains search page iframe . If you try to search for a text it will rarely fit the page. I don't know what code to use to auto resize iframe based on content changes. Right now I use this code in iframe : <body onload="parent.alertsize(document.body.scrollHeight);"> And this javascript in parent page : <script> function alertsize(pixels){ pixels+=32; document.getElementById('my-iframe').style.height=pixels+"px"; } </script> 回答1: <script type="text/javascript"> var

Fancybox 2 in iframe of facebook page with a page load

只谈情不闲聊 提交于 2019-12-13 06:18:13
问题 I'm trying to make an application in a facebook page with the use of fancybox 2 where a page is loaded as an iframe in the fancybox. It works all fine, except in IE (who would've known!). In my fancybox 2 there is a button that submits a form and sends you to another page. this page is loaded in the same fancybox window as the previous page. When this page is loaded, the height of the fancybox is not adjusted properly, so half of my page is not visible. What I'm trying to do now is change the

Cant Create STYLE tag in iframe head

江枫思渺然 提交于 2019-12-13 06:14:03
问题 Here's jsfiddle --> http://jsfiddle.net/uTy5j/7/embedded/result/ I'm using CodeMirror and it seems that Codemirror is erasing my style tag that I create with: var preview = document.getElementById('preview'); var mypreview = preview.contentDocument; mypreview.open(); mypreview.close(); var style = document.createElement('style'); style.id = 'mycssid'; style.type ='text/css'; mypreview.head.appendChild(style); Can anyone figure out how I can get this style tag appended to the head of the

External JavaScript doesn't work in iFrames?

十年热恋 提交于 2019-12-13 05:57:42
问题 I'm trying to create an iframe whose contentWindow.document is a document that I've created myself. I create the frame using: var myFrame = document.createElement("iframe"); I create the document using: var doc = document.implementation.createHTMLDocument("sampleTitle"); I use $.get() and a callback function to retrieve the innerHTML data of the page view I want to place in the iframe, then I place that data into the document by altering doc.body.innerHTML and doc.head.innerHTML . Finally, I

Facebook Embedded Post: force mobile view

試著忘記壹切 提交于 2019-12-13 05:57:09
问题 i've created a web platform where you can insert 'facebook embedded posts'. Facebook Embedded Posts Docs As you can see, i can show a post on my pages simply with <div class="fb-post" data-href="{your-post-url}"></div> With this tag, you can show a post in Desktop version: from 350px to 750px width. The mobile view will be used automatically only on mobile devices. Docs says: "On mobile web, Embedded Posts automatically scale to the width of the container." The problem is that i'd like to

JQuery Loading Content of textarea into IFrame

坚强是说给别人听的谎言 提交于 2019-12-13 05:51:48
问题 I have an HTML textarea, and an IFrame. On a button click, I would like to be able to load the content of the textarea into the IFrame. For example, when the user types in Hello World into the textarea, and presses the submit button, the text Hello World would show up in the IFrame. Any ideas on how this could be done? Thanks in advance. NOTE: I would like to use JQuery, but I think I'll have to use PHP for this. It sounds more server side. 回答1: You can target the iframe with jquery only:

Embedding HTML5 video in Tumblr (dashboard and blog)

强颜欢笑 提交于 2019-12-13 05:50:42
问题 Bit curios about the possibility to embed a custom HTML5 video player into Tumblr. How it works now is basically that you put in an URL or embed code to Youtube or any other service and it'll load up the video and show it in the dashboard feed and on your blog. I just checked with Vimeo, and in that case it seems like it fetches a vimeo iframe with the video (I guess it's their embed code) and inject it into the DOM when the play button is pressed. Would it be possible to mimic this behaviour

Track number of impressions of a widget running on a remote website

这一生的挚爱 提交于 2019-12-13 05:50:33
问题 I have created a widget that is being hosted on a number of websites. I originally implemented the code using only jquery and JSONP to buid the widget. Upon implementing the widget on live webiste though we had the unfortunate experience of that other widgets which were on the site already had really poor javascript in them which killed our widget, so to cut a long story short I have created a second version which works using an IFrame. I have read up on the google analytics site that you can

AngularJs same model for main window and iframe window

一笑奈何 提交于 2019-12-13 05:46:00
问题 I am trying to open a new iframe window upon clicking some link on the main window. However, I would like to use the same model i.e if the data changes in main window, it should be reflected in iframe and vice versa. Main window UI will have couple fields whereas iFrame window will have all the fields. I am pretty new to angujar world, is it doable? If yes, any suggestions? 回答1: The concept of multiple templates on an angularjs page is trivial using the ngInclude directive. And the ngCompile