PDA

View Full Version : Clickable image link not working...


AndyArmstrong
08-15-2007, 12:33 PM
If you navigate to :

http://www.3genergi.co.uk/index.php?module=webpage&id=11

The code for the first image is :


<a href="index.php?module=webpage&amp;id=7"><img width="132" height="135" alt="" src="themes/default/img/kunzelp.jpg" style="float: left;" title="More Info" class="imgcaption" /></a>


and the second :


<a href="index.php?module=webpage&amp;id=18"><img width="102" height="135" src="themes/default/img/kunzelpsmall.jpg" alt="" style="float: left;" title="More Info" class="imgcaption" /></a>


Now. This should infact make the images ,on click, go to the specified pages - it does this in Firefox nicely! However under IE it only works when you click the text underneath (the caption)

Why is this!

Thanks

Andy

SouthwaterDave
08-15-2007, 02:53 PM
It all rather depends on what the Javascript code in arc90_imgcaption.js does. An easier way to achieve what you want here would be to code your hyperlink as follows:<a href="..."><img ...><br />More Info</a>

AndyArmstrong
08-15-2007, 03:06 PM
it basically puts all the More Info captions neatly nested below each image.

the <br /> method probably wont look as neat to be honest.

The path to the script is :

http://www.3genergi.co.uk/themes/default/js/arc90_imgcaption.js

if you want to have a look and tell me what you think!

Thanks dave

AndyArmstrong
08-16-2007, 09:58 AM
any ideas?

Nothing in that javascript would offput a embedded img tag within a link would it?

AndyArmstrong
08-17-2007, 09:50 AM
Anyone please help here?

garydarling
08-17-2007, 02:14 PM
That is a very large script doing a very small job that can easily be done with css, and your site is presently a bandwidth hog. Run it thru websiteoptimization.com and you will see what I mean.

You might try adding this css to see if it helps:

a arc90_imgcaption {display:block}

That tells IE to treat the entire <a> element like a link rather than just the text within the element, similar to how FF does naturally. Not sure if it will help in your case, I think your javascript overly complicates things.

Good luck

Gary

garydarling
08-17-2007, 02:34 PM
An easier way to achieve what you want here would be to code your hyperlink as follows:<a href="..."><img ...><br />More Info</a>

You can take Dave's idea, wrap the More Info inside a <span class="moreinfo"> tag, style the .moreinfo class to position it relative to the image above, and voila, lose 3.69kb of needless javascript.

<a href="..."><img ...><span class="moreinfo">More Info</span></a>

I guess it's not a huge script by itself, but you have a lot of scripts loaded already.

Right next to the More Info link you have an html link that says and does the same thing; personally I think you don't need the More Info tag at all.

Gary

AndyArmstrong
08-17-2007, 03:46 PM
Strange didnt even consider removing it, that what i have done and it works, that'll do nicely!

Thanks

Andy