aliento Posted October 31, 2008 Share Posted October 31, 2008 I want to center the result of the function and i cant center the div : <script type="text/javascript"> function load_movie() { var so = new SWFObject('movie/player.swf','mpl','360','260','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=/movie/movie.flv&autostart=true'); so.write('content'); } </script> The div : <div id="content" style=" width:449px;height:230px; overflow:hidden;"> Any advise? Link to comment https://forums.phpfreaks.com/topic/130831-solved-with-javascript/ Share on other sites More sharing options...
webster08 Posted October 31, 2008 Share Posted October 31, 2008 try this: <script type="text/javascript"> function load_movie() { var so = new SWFObject('movie/player.swf','mpl','360','260','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('align','center'); so.addParam('salign','middle'); so.addParam('flashvars','&file=/movie/movie.flv&autostart=true'); so.write('content'); } </script> here is a full reference; if the above code does not work: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701&sliceId=1 Link to comment https://forums.phpfreaks.com/topic/130831-solved-with-javascript/#findComment-679073 Share on other sites More sharing options...
F1Fan Posted October 31, 2008 Share Posted October 31, 2008 Or: <script type="text/javascript"> function load_movie() { var so = new SWFObject('movie/player.swf','mpl','360','260','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=/movie/movie.flv&autostart=true'); so.write('content'); document.getElementById('content').style.textAlign = 'center'; } </script> Link to comment https://forums.phpfreaks.com/topic/130831-solved-with-javascript/#findComment-679333 Share on other sites More sharing options...
BoltZ Posted October 31, 2008 Share Posted October 31, 2008 To center the div use margin:0 auto Link to comment https://forums.phpfreaks.com/topic/130831-solved-with-javascript/#findComment-679530 Share on other sites More sharing options...
aliento Posted November 1, 2008 Author Share Posted November 1, 2008 Or: <script type="text/javascript"> function load_movie() { var so = new SWFObject('movie/player.swf','mpl','360','260','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=/movie/movie.flv&autostart=true'); so.write('content'); document.getElementById('content').style.textAlign = 'center'; } </script> This works great, thank you! Link to comment https://forums.phpfreaks.com/topic/130831-solved-with-javascript/#findComment-679859 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.