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? Quote 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 Quote 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> Quote 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 Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/130831-solved-with-javascript/#findComment-679859 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.