Silverlight 控件向浏览器窗口添加滚动条
虽然是 silverlight 新手,但我已经制作了一个可点击的地图。 [注:它比使用 html 标签更好,因为地图的轮廓与每个区域的精确轮廓相匹配,并且很容易生成上下文菜单)。
我必须调整地图大小,现在它正在向浏览器窗口添加一个全新的滚动条:我现在有两个垂直滚动条。不利于可访问性和可用性。
问题是:为什么我会得到这个额外的滚动条?
HTML:
<div id="silverlightControlHost" style="padding: 0px; border: 2px solid #999; margin: 5px;
width: 575px; height: 525px;">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
width="575" height="525">
<param name="source" value="../ClientBin/RegionsES.xap" />
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40818.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style="text-decoration: none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
style="border-style: none" />
</a>
</object>
<iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
border: 0px"></iframe>
</div>
它看起来像什么:
有什么建议吗?
Although new to silverlight, I have produced a clickable map. [Note: it is better than using html tags because the contours of the map match the exact contour of each area, and it is easy to produce a context menu).
I had to resize the map and now it is adding a whole new scrollbar to the browser window: I now have TWO vertical scrollbars. Not good for accessibility and usability.
Question is: Why am I getting this extra scrollbar?
HTML:
<div id="silverlightControlHost" style="padding: 0px; border: 2px solid #999; margin: 5px;
width: 575px; height: 525px;">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
width="575" height="525">
<param name="source" value="../ClientBin/RegionsES.xap" />
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40818.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style="text-decoration: none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
style="border-style: none" />
</a>
</object>
<iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
border: 0px"></iframe>
</div>
what it looks like:
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所有这些看起来都不错,我将验证包含此 div 的 HTML 不是溢出创建滚动条的实际罪魁祸首。
其中一个控件的高度超过父元素的某个位置可能不在 xap/wrapper div 中,而是在 html 树的更高位置。
All this looks ok, I would verify the containing HTML holding this div is not the actual culprit overflowing creating the scrollbar.
Somewhere one of you controls height is exceeding the parent element may not be here in the xap/wrapper div but higher up the html tree.
任何浏览器都会出现这种情况还是仅在 IE 中出现这种情况?
如果只是在 IE 中,您可能遇到了我描述的问题 这里。
解决方案是将_sl_historyFrame div 的样式设置为overflow='hidden'。
Does it happen on any browser or just in IE?
If it's just in IE, probably you are running into the problem I described here.
The solution is to set overflow='hidden' to the _sl_historyFrame div's style.