Guest Posted December 5, 2004 Posted December 5, 2004 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
cmbyrne Posted December 5, 2004 Posted December 5, 2004 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 <{POST_SNAPBACK}> 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
Guest Posted December 5, 2004 Posted December 5, 2004 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>
Jack_mcs Posted December 5, 2004 Posted December 5, 2004 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> <{POST_SNAPBACK}> Change thistep_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
Guest Posted December 5, 2004 Posted December 5, 2004 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
Guest Posted December 5, 2004 Posted December 5, 2004 Pull the screen resolution via javascript and use GD to resample / resize on the fly (of course saving the resampled images for reuse).
Guest Posted December 5, 2004 Posted December 5, 2004 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
Jack_mcs Posted December 5, 2004 Posted December 5, 2004 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 <{POST_SNAPBACK}> 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
Jack_mcs Posted December 5, 2004 Posted December 5, 2004 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 <{POST_SNAPBACK}> 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.