X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Add random image as background - works in Safari only... (https://forum.x-cart.com/showthread.php?t=20320)

dannyrus 03-05-2006 01:23 PM

Add random image as background - works in Safari only...
 
Hi, I've added some script to randomly display one of 3 images on my homepage, but I've set it to display in the background of a table so that if the window is resized it just shows more or less of the image.

For some reason it only displays correctly in Safari on Mac. I've tested on Firefox, Opera, Netscape & Explorer on PC and Mac and none of these display correctly. The code for the table (in /customer/main/welcome.tpl) is:

Code:

<table width="100%" height="290" border="0" cellspacing="0" cellpadding="0" background="{$ImagesDir}/homepics/psco{"1"|mt_rand:3}.jpg" class ="HomepagePics">
  <tr>
    <td></td>
  </tr>
</table>


And the CSS style I've attached to the table is:

Code:

.HomepagePics {
        background: #fff no-repeat;
}


Can anyone see why it won't display in most browsers??

If I have the image display directly in the table it works in all browsers but it stretches the screen to the size of the image which I don't want. That code is:

Code:

<table width="100%" height="290" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>[img]{$ImagesDir}/homepics/psco{[/img]</td>
  </tr>
</table>


Thanks for any help!! - I have asked this one before but had no replies :(

balinor 03-28-2006 05:19 AM

Have you tried setting the background image using CSS? The way you are using is not valid html anymore :(


All times are GMT -8. The time now is 09:34 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.