Hi,
I have a full browser flash website. Some of te pages contain a lot of
text, so I want to use the browser scrollbars to scroll content. I
made two extra functions to do this: setViewPortHeight and
resetDefaultViewport.
>From my flash file I call these function when changing pages:
ExternalInterface.call("setViewPortHeight", newViewPortHeight);
This works great in Internet Explorer and Firefox. But nog in Internet
Explorer 6. You can see a working example at http://www.econergie.be/v2/
What can be the reason?
<script type="text/javascript">
var nHeight = 775;
function setViewPortHeight(newHeight){
nHeight = newHeight;
document.getElementById("container").style.height = newHeight +
"px";
resetDefaultViewport();
}
function resetDefaultViewport(){
var el = document.getElementById("container");
var size = getViewportSize();
el.style.width = size[0] < 950 ? "950px" : "100%";
el.style.height = size[1] < nHeight ? nHeight + "px" : "100%";
}
function getViewportSize() {
var size = [0, 0];
if (typeof window.innerWidth != "undefined") {
size = [window.innerWidth, window.innerHeight];
}
else if (typeof document.documentElement != "undefined" && typeof
document.documentElement.clientWidth != "undefined" &&
document.documentElement.clientWidth != 0) {
size = [document.documentElement.clientWidth,
document.documentElement.clientHeight];
}
else {
size =
[document.getElementsByTagName("body")[0].clientWidth,
document.getElementsByTagName("body")[0].clientHeight];
}
return size;
}
function createFullBrowserFlash() {
swfobject.createCSS("html", "height:100%;overflow-y: scroll;");
swfobject.createCSS("body", "height:100%;");
swfobject.createCSS("#container", "margin:0; width:100%; height:100%;
min-width:950px; min-height:" + nHeight + "px;");
window.onresize = function() {
var el = document.getElementById("container");
var size = getViewportSize();
el.style.width = size[0] < 950 ? "950px" : "100%";
el.style.height = size[1] < nHeight ? nHeight + "px" : "100%";
};
window.onresize();
}
.....
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---