简体   繁体   中英

cannot scroll iframe content on Firefox

I am using a modal window on my page, which actually has a frameset page called within an iframe. The code to dynamically append the modal window is like;

$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");

The generated HTML looks like;

<div id="TB_window" style="margin-left: -500px; width: 1001px; display: block;">
<iframe frameborder="0" style="width:1000px;height:581px;" onload="tb_showIframe()" name="TB_iframeContent805" id="TB_iframeContent" src="framesetPg.html" hspace="0"> </iframe></div>
</div>

Now while on IE, I can scroll through the main page as well as the inner frames, on Firefox, I cannot scroll completely through the main frameset page..

Also to summarize this issue and this is something which should help identify where the problem lies; If I hide the Windows Taskbar so that more vertical space is available for Firefox window, I can see the complete frameset page...So something like viewport or based on display height. Reverse is also true ie if I drag the taskbar up, so that less space is available for FF, it only shows that much content and I cannot scroll the rest..

Please help me. Thank you.

Add this

$("body").css("overflow", "auto");
$("html").css("overflow", "auto");

to top of tb_show function in thickbox.js uncompressed here is exapmple This is How it's look

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link

    try {
        if (typeof document.body.style.maxHeight

change it to this

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
    $("body").css("overflow", "auto");
    $("html").css("overflow", "auto");
    try {
        if (typeof document.body.style.maxHeight

And leave the rest in peace if not work post it to jsfiddle let me see it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM