Dynamically resizing Iframe to work with Chrome - javascript

i'm looking by a week for a code to dynamically resizing an IFrame (by its content) to work with Google Chrome.
I tried every code I found, failing miserably.
Can someone help me?

This works for all Chrome, I.E. and FF.
(I didn't test it on other browsers)
$(function ()
{
$('iframe').height($('iframe').contents().height());
});

Related

Chrome extension options not always displayed

I'm building a chrome extension and I've an options page.
This page is an overlay in the chrome://settings as described in the documentation.
The problem is that my page isn't always displayed, sometmies it just stays white without any content. When I try and inspect the overlay, my code is loaded.
What could be the problem?
I've added some screenshots to show the problem:
Working options page:
Working source code:
Not working options page:
Not working source code:
This is a known Chrome bug: crbug.com/550217
Try forcing the page to redraw on load:
window.onload = function() {
document.body.style.webkitTransform = "scale(1)";
};
I've found a solution in the provided url: Issue 550217
I've enabled my HWA and it's shows up a lot more now. Don't know if it really solved the problem but it works for now.

Setting content of iframe using javascript fails in firefox

I'm trying to set the content of a iframe using javascript.
I've the html string. And I'm writing:-
var iframe = $('iframe')[0],
content = '<div>test</div>';
$(iframe).contents().find('html').html(content);
It works fine in google chrome, but in firefox is shows the content for a moment and the disappears.
Please help me to fix it.
I faced the same problem. I saw the load function of iframe fires in firefox but not in chrome. So firefox reload the iframe again on load event.
So with your existing code try this:-
$(iframe).load(function(e){
$(iframe).contents().find('html').html(content);
})

Why javascript is not working on safari?

I am developing a website with has a header as (channels,...) and the header is working fine in all the browser except safari. The code is work fine on chrome as well still i facing the issue on safari browser. Is there anything which i missed in the code specified in the link. I also tried with the code to fetch browser and write a separate code for it but it also not works for me. Should anybody help me how to fix it. What i have already tried is : http://www.code-dynamix.com/blazemedia/services-channels.html
Problem exist at the Second header (Channels,...) where slider comes little bit down in safari.For better clarification just see the same header in any other browsers such as firefox, chrome and then see the header in safari.
Thanks in advance.
The JavaScript works fine for me in Safari 5.1.7 on Windows 7, but there are differences with how the header is rendered. This is an issue with CSS however. As best I can tell, there are no defined heights on any of the containing elements. You should define the heights when you can, this will help keep a universal look and feel.

Ascensor.js IE8

I am working on a new site, currently hosted here. I am implementing a single page design using the Ascensor plugin, found here. It works fine in Chrome and Firefox, and IE10 and IE9. However, in IE8, the home page loads and then if I click on any of the navigation icons, the page starts shaking, literally shaking left and right very fast, and the browser crashes after a few seconds. I have used Ascensor in IE8 before, and it had worked. I can't even debug as it just crashes without any warning in IE8. I've been trying to figure out what's wrong for the past few hours, with no success.
I checked the behavior in IE8 by:
Changing the document mode to IE8 in IE10.
Using a Win7-IE8 VM
If it helps, I am also using the following jQuery plugins on the page.
CarouFredSel and FancyBox for the gallery.jQuery custom content scroller
Also, I am using jQuery 1.8.3 as Ascensor does not run correctly using later versions.
Someone please point me in the correct direction. Thanks.
The issue was related to the scrollbar (not sure why it was occurring though). Using the following CSS on the body fixed the issue.
body
{
overflow: hidden;
}

Photoslide javascript is working in Firefox but not in IE

I have got three pages/divs sliding through (on one index page) using javascript/jquery, and a couple of pages/divs are set on timer. Please see my code and function on http://jsfiddle.net/EXfnN/35/
Everything is working perfectly in Firefox, but the slide and the timer are not working in IE.
How can I fix this javascript/IE problem please? Thanks in advance.
If the code you posted is the actual code you're using, comment out or remove the console.log statement. IE chokes on them if the debugger isn't open.

Categories

Resources