Frameset + cols IE10

别说谁变了你拦得住时间么 提交于 2019-12-03 13:25:45

For me the following seems to work (Its somewhat like Raads fix)

parent.document.getElementById("framesets").cols="0,24%,*";
parent.document.getElementById("framesets").rows=parent.document.getElementById("framesets").rows;  //IE10 bug fix

I've found a Solution

(it's a workaround til Microsoft solves IE 10 bug):

After working on .cols I call a script that forces frame redraw, in your example the result should look like this:

parent.document.getElementById("framesets").cols = "500,*";
$('#frame2').forceRedraw(true);

The forceRedraw script can be found here: Howto: Force a browser redraw/repaint, and needs a link to jQuery to work.

I've got the same problem in IE10. It worked in IE8 and IE9 and it works also in IE11 preview. So it seems to be an IE10 bug.

My simplest workaround is one line, requires no plugins or additional function and looks like this:

$('#framesetId').hide().attr('cols', '50,*').show();

This solution works for me in IE10 and is still working in all other modern browsers.

TomW

I spent quite a bit of time on this. I wanted to get this resolved without the need of jQuery.
Use this code to make Internet Explorer 10 take effect on the change of cols:

parent.document.getElementById("framesets").removeAttribute("cols");
parent.document.getElementById("framesets").setAttribute("rows", "500,*");
parent.document.getElementById("framesets").removeAttribute("rows");
parent.document.getElementById("framesets").setAttribute("cols", "500,*");

Here's what worked for me...

The redraw method that Emanuele describes above is the right solution. However, the referenced plugin is no longer available at the jQuery plugin site.

Here's what worked for me to force IE10 to set a frame column attribute...

1) Create a small jQuery plugin that instantly hides and shows an element, effectively redrawing it.

(function ($) {
    $.fn.redrawFrame = function () {
        return $(this).each(function () {
            $(this).hide();
            $(this).show();
        });
    }
})(jQuery)

2) Reference it in your JavaScript as follows:

$('#framesetId').attr('cols', '50,*').redrawFrame();

I solved this IE10 bug with adding these lines after cols attribute update line (using jquery):

$('#yourframeid').height( $('#yourframeid').height()+1 ); $('#yourframeid').height( $('#yourframeid').height()-1 );

I hope it will work for you...

Vivek Sharma

I resolved this ie 10 bug after a bit research. I found that only 'cols' attribute is not working for iframes but the 'rows'attribute is working, so i added a row and it worked for me.

var frameSet = document.getElementById("uxResultsFrameset");

if ($.browser.msie && $.browser.version == 10) 
     frameSet["rows"] = "100%"; //sets a row to overcome the issue in case of ie10 only

frameSet[orient] = "50%,50%";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!