I have a page which has an iframe.
The iframe has a button which opens a new popup window.
I want a CSS to be applied to the popup window.
The page for the popup window is a third party application.
So I cannot add CSS for that.
Is there a solution for this?
You can't apply css directly. But with js you can add style tag to iframe content - and put rule there ( or link to css file )
Related
I need to use a webpage as an Iframe, but the page has a button that expands a chat window. The problem is, how do I insert an Iframe without disableling the content that's behind it?
It's supposed to show just the button (from the other page) then, when it's clicked, the iframe should expand itself.the background is just for visual purposes
If you load an external Modal dialog with bootstrap in MVC, its easy to set the height, for example:
$(".modal-body").height(300);
However, if I then send another view to that same popup (if they click a link within the popup which hits your controller and you return a different view to the existing popup window), then you may have a different size of content in this new view. So how can you resize the external modal dialog now?
My thought was to put JS code in that new view, and have an onload event:
<script type="text/javascript">
$(document).ready(function () {
$(".modal-body").height(530);
alert("hit.");
});
</script>
Well this code hits (the alert debug message 'hit' does show up), but the dialog height doesn't change from 300 to 530. So, perhaps the JS doesn't have access to that part of the DOM?
How can I get this second view within the same Modal dialog to have the correct height for its content?
thanks
So there was a Iframe inside of the popup and that was why the popups content size was not changed. There exists an issue where the popup content change isnt noticed anyway, but that is solved with the code I already had, posted above, but the below solves when its in an iframe if on the same domain as well.
The solution was on the site that the SRC in the iframe pointed to (the content of the popup) since hosted on the same domain, was to do:
parent.$(".modal-body").height(530);
parent.$("#myIframeId").height(500);
I'm using CKEditor with my custom iframe dialog.
CKEDITOR.dialog.addIframe(
'myCustomPluginIframe',
'Add New Command',
'/Test/AddNewCommand', 360, 110,.......
The problem is that when I'm opening dialog it's taking some time before it loads iframe in it. How can I show some loading gif image before that or maybe load iframe before clicking on the button(load iframe with CKEditor)?
Use dialog event show (here) to add your custom preloader HTML code and iframe event onContentLoad (here) to hide or remove it.
I have a fancybox iframe and css is written on parent page. but css is not working in Fancy box but when i change to ajax it is working properly.
If you have something in iframe you have to set the css for the page inside it too, If u want it to work. The css for the main page works just for the main page not for the iframe content.
This is a tricky one. I have a link on my page that opens a Colorbox iframe to an external website. The external website contains links to another page. When the user clicks those links, I need them to load up in the same iframe.
The problem is, the link on that external site is set to open a new window with target="_blank". Therefore, instead of this page loading within the same colorbox iframe like I need it to, it opens a totally new window.
Is there any way to bypass it so that these links within the iframe do not open a new window, and instead load that window within the same colorbox iframe?
Thanks in advance!
_blank will always open a new window, you could try _TOP instead, it should work something like this;
<a onclick="parent.$.fn.colorbox.close();" href="NEW SITE" target="_top">
open in parent window with animation
</a>
Do you control the document that is being displayed in the iframe? If so you could handle things a little differently so that you only opened new windows if the document isn't being displayed in an iframe. But if the document you are iframing isn't under your control then I don't think there is anything you can do about it.