5D艺术网首页
商城
|
资讯
|
作品
|
博客
|
教程
|
论坛
登录
注册
加为好友
发短消息
来自:bj
性别:先生
最后登录:2018-10-12
http://yitu.5d.cn/
首页
|
新闻
|
话题
|
博客
|
相册
|
艺术作品
|
社交关系
|
留言板
|
社交圈
2007/02/02 | Flash全屏功能测试
类别(flash As)
|
评论
(0)
|
阅读(35)
|
发表于 10:49
在线测试页面:http://www.klstudio.com/demo/as/fullscreen/fullscreen.html
相关资料文件:http://www.klstudio.com/demo/as/fullscreen/fullscreen.rar
<div
id
=
"flashcontent"
></div>
<script
language
=
"javascript"
src
=
"js/swfobject.js"
></script>
-
<script
language
=
"JavaScript"
>
var
orginFlash
=
{
init
:
false
,
isFullScreen
:
false
,
position
:
""
,
top
:
""
,
left
:
""
,
width
:
""
,
height
:
""
};
-
function
writeFlash
(){
var
so
=
new
SWFObject
(
"fullscreen.swf"
,
"fplayer"
,
"100%"
,
"100%"
,
8
,
"#FFFFFF"
);
so.addParam
(
"quality"
,
"high"
);
so.addParam
(
"swLiveConnect"
,
"true"
);
so.addParam
(
"menu"
,
"false"
);
so.addParam
(
"allowScriptAccess"
,
"sameDomain"
);
so.addParam
(
"allowFullScreen"
,
"true"
);
so.write
(
"flashcontent"
);
}
-
function
getScreenSize
(){
var
w
=
0
;
var
h
=
0
;
-
if
(
typeof
(
window.innerWidth
)
==
'number'
)
{
w
=
window.innerWidth
;
h
=
window.innerHeight
;
}
else
if
(
document.documentElement
&&
(
document.documentElement.clientWidth
||
document.documentElement.clientHeight
)
)
{
w
=
document.documentElement.clientWidth
;
h
=
document.documentElement.clientHeight
;
}
else
if
(
document.body
&&
(
document.body.clientWidth
||
document.body.clientHeight
)
)
{
w
=
document.body.clientWidth
;
h
=
document.body.clientHeight
;
}
return
{
width
:
w
,
height
:
h
};
}
-
function
fullScreen
(){
-
if
(!
orginFlash.init
){
orginFlash.position
=
document.getElementById
(
"flashcontent"
)
.style.position
;
orginFlash.top
=
document.getElementById
(
"flashcontent"
)
.style.top
;
orginFlash.left
=
document.getElementById
(
"flashcontent"
)
.style.left
;
orginFlash.width
=
document.getElementById
(
"flashcontent"
)
.style.width
;
orginFlash.height
=
document.getElementById
(
"flashcontent"
)
.style.height
;
}
orginFlash.init
=
true
;
orginFlash.isFullScreen
=
true
;
var
screenSize
=
getScreenSize
();
-
try
{
document.getElementById
(
"flashcontent"
)
.style.position
=
"absolute"
;
document.getElementById
(
"flashcontent"
)
.style.top
=
"0px"
;
document.getElementById
(
"flashcontent"
)
.style.left
=
"0px"
;
document.getElementById
(
"flashcontent"
)
.style.width
=
screenSize.width
+
"px"
;
document.getElementById
(
"flashcontent"
)
.style.height
=
screenSize.height
+
"px"
;
document.body.style.overflow
=
"hidden"
;
window.scrollTo
(
0
,
0
);
}
catch
(
e
){
}
}
-
function
normal
(){
-
if
(
orginFlash.init
){
orginFlash.isFullScreen
=
false
;
-
try
{
document.getElementById
(
"flashcontent"
)
.style.position
=
orginFlash.position
;
document.getElementById
(
"flashcontent"
)
.style.top
=
orginFlash.top
;
document.getElementById
(
"flashcontent"
)
.style.left
=
orginFlash.left
;
document.getElementById
(
"flashcontent"
)
.style.width
=
orginFlash.width
;
document.getElementById
(
"flashcontent"
)
.style.height
=
orginFlash.height
;
document.body.style.overflow
=
"auto"
;
}
catch
(
e
){
}
}
}
-
function
reSize
(){
-
if
(
orginFlash.isFullScreen
){
fullScreen
();
}
}
window.onresize
=
reSize
;
writeFlash
();
</script>
0
评论
Comments
日志分类
首页
[193]
flash As
[107]
有的没的
[59]
数码照片
[4]
自由世界
[19]
blender
[4]