Jump to content

Java Script Avail.width


kv79
 Share

Recommended Posts

hi allthanks advance this is not working, I really don know why

<script type="text/javascript">var _screen = screen.availWidth;var _width = 495;var _left = ((_screen/2)-_width);document.getElementById('movie').style.left='100px';</script>		<style type="text/css">		div.movie, body, p {			position:absolute;			  		}		p.underline, p , h1 , h2 , u {			position:absolute;			left:5px;			width:100px;			height:100px;			overflow:hidden;		}		p.underline{text-decoration:underline;}		body { margin:0; }		body {background-color:#000;}	</style></head><body>	<div id="movie" class="movie" >		<embed  src="pre_loader.swf" width="991" height="550" />	</div>	</body>

Link to comment
Share on other sites

Take the quotation mark out of your alert, and it should work.The screen width refers to the total width of the monitor. That is not the same as your window. If the user changes the size of the window, then the window will be smaller than the screen.If you are simply trying to center your movie, there are easier ways that do not require Javascript.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...