Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

howto make top banner use a % instead of pixels ?


Guest

Recommended Posts

Posted

hi, does anyone how i'd go changing the code to change the top banner that is in header.php use % instead of just displaying the image no matter what size it is ? ive tried but keep causing erros lol.

 

thanks again

 

Lee

Posted
hi, does anyone how i'd go changing the code to change the top banner that is in header.php use % instead of just displaying the image no matter what size it is ? ive tried but keep causing erros lol.

 

thanks again

 

Lee

 

i believe someone just answered this question for me in the other forum

 

near the top of header.php you will see this:

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 

change 100% to the pixels you want and i think you will be good.

 

Christina

Posted

im not after using pixels, i want the image to resize automatiaclly to use 100% width and 11.12% height of the page the code is below that is currently in

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr class="header">

<td align="left" valign="bottom" width="100%"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'topbanner.jpg', 'Plumb-Direct.Com') . '</a>'; ?></td>

</tr>

</table>

Posted
im not after using pixels, i want the image to resize automatiaclly to use 100% width and 11.12% height of the page the code is below that is currently in

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

  <tr class="header">

    <td align="left" valign="bottom" width="100%"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'topbanner.jpg', 'Plumb-Direct.Com') . '</a>'; ?></td>

  </tr>

</table>

Change this
tep_image(DIR_WS_IMAGES . 'topbanner.jpg', 'Plumb-Direct.Com') .

to this

tep_image(DIR_WS_IMAGES . 'topbanner.jpg', 'Plumb-Direct.Com', '600', '100') .

This will change your image to 600x100 so you need to put in the correct values. You can put in percentages but I don't think it will give you the result you want. The better way is place the image in a table as a background image and set the dimensions of the table.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

i tried the table way, all i can get it to do that, but if the screen res is too high, the image repeats itself and doesnt stretch, also theres a gap at the top of the screen when i do that

Posted

Pull the screen resolution via javascript and use GD to resample / resize on the fly (of course saving the resampled images for reuse).

Posted

nah sorry i really dont have much of an idea to what you are talknig abuot, there must be way i can make the header auto adjust to any resolution size, as you can imagine it is quite irritating to me, and to customers, any other help would be greatly appreciated

 

thanks

Posted
i tried the table way, all i can get it to do that, but if the screen res is too high, the image repeats itself and doesnt stretch, also theres a gap at the top of the screen when i do that

You need to add a no-repeat tag.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
nah sorry i really dont have much of an idea to what you are talknig abuot, there must be  way i can make the header auto adjust to any resolution size, as you can imagine it is quite irritating to me, and to customers, any other help would be greatly appreciated

 

thanks

Do a google search for detecting screen size with javascript. There will be quite a few examples. There was also one posted in the forums not too long ago so you may want to search here also.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Archived

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

×
×
  • Create New...