<a href="residential.html" class="textdeco" >
<img class="img-menu" id="res" src="images/buttons/btn_res_mouse_out.jpg" alt="Residential"
The reason I want to do this is that this code is repeated in all pages and I want to reduce potential maintenance issues. Any help will be appreciated.
Well, for starters I would try to find something a bit smarter than that FP_swapImg function.
Why would you pass the id of an image when you could instead just pass this and thereby pass the correct reference.
And I don't know what the 1,0 and 0,0 are for, but I'll bet they are pretty useless, too. If not, please prove me wrong.
But the big problem: How do you pass along all four image URLs without the separate calls?
The answer is actually pretty easy. *IF* you use a *CONSISTENT* naming convention for all the images, we can do it by text pattern substitution.
For the sake of argument, let's assume that all your image names *END* in the pattern "_mouse_xxx.jpg".
So now it's pretty easy:
Thanks for the post. The original code that I posted was already in the web pages. I have not taken the time to dig into the code to see why it works and I knew there had to be a better and simpler way to do what this was doing, I just needed a boost in the right direction. I will check out what you posted to see how I can use it. Thanks again!!:thumbsup:
|All times are GMT +1. The time now is 01:13 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.