iframe

Load IFRAME onClick

旧时模样 提交于 2019-12-13 05:37:36
问题 I have IFRAMEs loading onClick. The problem with the following script is that always loads the content of the first iframe, while I'm expecting to load JUST the right iframe when I click on the relative link. $('.toggle-next-div').click(function(){ var iframe = $("#myiFrame"); iframe.attr("src", iframe.data("src")); }); HTML <a href="#" class="toggle-next-div">Map</a>// iframe (1) <iframe id="myiFrame" data-src="my-url" src="about:blank"></iframe <a href="#" class="toggle-next-div">Map</a>//

How to change IFrame styles from IFrame itself using jquery?

走远了吗. 提交于 2019-12-13 05:32:20
问题 I have an iframe which will be inserted dynamically into the parent page ( I don't have control over this domain ) using following script... var _hf_iFrame = document.createElement("iframe"); _hf_iFrame.setAttribute("id", "_hf_iFrame"); _hf_iFrame.setAttribute("name", "_hf_iFrame"); _hf_iFrame.setAttribute("style", "height: 354px; width: 445px; border: 0; margin-left: -400px; top: 23%; position: fixed;"); document.body.appendChild(_hf_iFrame); _hf_iFrame.setAttribute("src", "http:/

Firefox - Javascript - window.event not surviving pass to context.apply()

北城以北 提交于 2019-12-13 05:24:34
问题 - This is the original question for posterity - I'm having a bit of trouble with a new piece of code I wrote. I'm trying to find the iframe the window that sent a message lives in, assuming it's from an iframe at all. The relevant code: var getContainingFrame = function(source){ var frames = document.getElementsByTagName('iframe'); for (var i = 0; i < frames.length; ++i) { if (frames[i].contentWindow === source) { return frames[i]; } } return false; } var postMessageReceivedCallback =

fancybox makes multiple request on iframe

淺唱寂寞╮ 提交于 2019-12-13 05:10:52
问题 I'm using the fancybox v2.1.5 for a .net application. I use the iframe for displaying an aspx-side. Works fine. But today I noticed, that the request to my aspx-page to be displayed in a fancybox was made 4 times. I tested it with another page - same issue. Here is all what I do: <a href='ChangePassword.aspx' class="fancybox fancybox.iframe" style="color:white;text-decoration:none;">Change password</a> This is the easy side, but in another there are some DB-Calls an many lines of code, so it

Display source html in iframe on rollover

两盒软妹~` 提交于 2019-12-13 05:06:04
问题 I have a db with one field containing the source html of webpages. I have a table that shows the url that leads to the source HTML. <table> <tr> <td>This is a Td</td> <td>This is a Td</td> <td class="hover">URL1</td> <td>This is a Td</td> </tr> <tr> <td class="hover">URL1</td> <td>This is a Td</td> <td>This is a Td</td> <td>This is a Td</td> </tr> </table> <div class="stuff"> </div> when I roll over a url in the table , I want to display the associated db HTML in an iframe. based on: http:/

Display gallery popup outside iframe

二次信任 提交于 2019-12-13 05:01:39
问题 I read some thread in here, but I haven't found a good solution for gallery item. I am not expery in jQuery so please bear with me here. I have code to display one image outside iframe. But my goal is to add left/right arrow to scroll through my gallery. I have this script <script type="text/javascript"> $(document).ready(function () { $('.fancybox').click(function (e) { e.preventDefault(); parent.$.fancybox({ type : "image", // force type of content to image href: this.href, title: this

How to target an item in an iframe with jquery

Deadly 提交于 2019-12-13 04:53:33
问题 How do I target and item in an iframe thats on my site and change the inline value? <iframe class="preview_iframe"> <div id="example"> <a id="ex"> <svg fill="#000000"></svg> </a> </div> </iframe> I need to target an SVG (multiple) in an iframe and change the fill (color) with jquery, how can I do this I tried but it doesn't seem to select it. Heres the jquery im trying $("[id^=like_iframe_]").load(function() { var frame = $("[id^=like_iframe_]").contents(); $("svg", frame).css({'fill' : 'red'

postMessage not being received from iframe

旧巷老猫 提交于 2019-12-13 04:49:59
问题 Here is the code in the iframe with src="example.com" <script> var domain = "http://example2.com"; function redirectRequest(){ console.log("window.opener",window.opener); // NULL console.log("window.top",window.top); // script_name console.log("window.parent",window.parent); // script_name opener.postMessage("redirect", domain); //fails because null //top and parent also do not work BUT do not display errors } </script> and here is the code running in example2.com which contains the

How to rotate an iFrame using javascript?

扶醉桌前 提交于 2019-12-13 04:48:30
问题 I have an iFrame: <div class="embed-responsive embed-responsive-16by9"> <iframe id="camera_view" class="embed-responsive-item container well well-small span6" style="height: 720px; width: 1280px; background-color: #2e2e2e;" src="www.google.com"> </iframe> </div> How to rotate using javascript? Note: I am using Bootstrap for CSS. jQuery for javascript. 回答1: There is the transform property in css3 #camera_view { transform: rotate(45deg); } hope it helps 来源: https://stackoverflow.com/questions

Remove focus from Iframe on page load

我们两清 提交于 2019-12-13 04:47:13
问题 I have an Iframe embedded like this: <iframe id="foo" src="http://www.something.com" style="width: 90%; height: 300px"></iframe> Each time the page loads focus gets lost from the top of the page and switches to this Iframe that is in the footer.I was wondering how can i remove the focus from this and make the page load "normally"? Thanks! Update: Yes, iframe is being loaded from another source (not the same domain) 回答1: if assumed the iframe is not served from the same domain.. you can place