Silverlight网站浏览器缩放问题

时间:2011-10-13 14:53:01

标签: asp.net css silverlight-4.0 cross-browser

我开发了一个Silverlight网站。我目前面临的问题是当我使用浏览器缩放时,它会显示没有浏览器滚动条的网站的放大版本。内容被剪裁。 请检查显示我的问题的这些图像。

http://demo.digi-corp.com/withzoom.jpg

http://demo.digi-corp.com/withoutzoom.jpg

以下是我的aspx页面中托管silverlight对象的设计代码。

< form id =“form1”runat =“server”style =“height:100%;”>     < div id =“silverlightControlHost”style =“background:#9EEE69;”>         < object id =“silverlightObject”data =“data:application / x-silverlight-2,”type =“application / x-silverlight-2”             width =“100%”height =“100%”>

    html, body
    {
        height: 100%;
        width:100%;
        overflow:auto;
    }
    body
    {
        padding: 0;
        margin: 0;
    }
    #silverlightControlHost
    {
        height: 100%;
        text-align: left;
        width: 100%;
     }

2 个答案:

答案 0 :(得分:1)

@brijesh;您必须在min-width标记中定义body,如下所示:

body
    {
        padding: 0;
        margin: 0;
        min-width:1000px;
    }

答案 1 :(得分:1)

创建javascript函数

function bodyLoadEvent() {
this.form1.style.height =(parseInt(document.body.offsetHeight) - 5)。toString()+“px”;
this.form1.style.width =(parseInt(document.body.offsetWidth) - 5)。toString()+“px”;
document.getElementById(“myhtmlbody”)。style.height =(parseInt(document.body.offsetHeight) - 5).toString()+“px”;
document.getElementById(“myhtmlbody”)。style.width =(parseInt(document.body.offsetWidth) - 5)。toString()+“px”;

}

并在体载上调用此函数。 即
< body onload =“bodyLoadEvent();”>
< form id =“form1”runat =“server”style =“height:100%;”>
.......
< / form>
< / body>

相关问题