Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using Javascript to set width of my <td>


Guest

Recommended Posts

Hi, Im looking for a way to set the width of things on my page depending on the screen resolution people are using the Javascript

 

screen.height

screen.width

 

i was hoping to doe something like this

 

<script language="javascript">
<?php $width; ?> = screen.width;
</script>

<?php
if($width > 800) {
$var = 200;
} else {
$var = 20%;
}
?>

store these values in a php $var and then put this in the width="$var"

 

im probably going about it in the wrong way but im pretty new and im having probs when people view my site in 800 x 600

 

Thanks for any help in advance

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...