PDA

View Full Version : need help with lightbox code



cybershot
10-07-2007, 07:23 AM
1) Script Title: lightbox

2) Script URL (on DD):

3) Describe problem: i got the lightbox working properly. i have read posts on here about how to get links working in the image and it is working. but the link only shows when i do a mouseover on the bottom left corner of the image. i have one test image working. i want the link to show the customary blue and allways be there so the people can see the link without having to accidently find it in the bottom left corner. here is the code i am using.


<a href="images1/image5.JPG" rel="lightbox[map]" title="<a href='http://www.cybersmods.com/modules.php?name=Downloads&op=getit&lid=2/'>DOWNLOAD THIS MAP</a>"><img border="0" src="images1/thumb5.jpg"/></a></td>

jscheuer1
10-07-2007, 04:01 PM
Add a class to the link(s), ex:


<a href="images1/image5.JPG" rel="lightbox[map]"
title="<a class='inbox' href='http://www.cybersmods.com/modules.php?name=Downloads&op=getit&lid=2/'>DOWNLOAD THIS MAP</a>"><img
border="0" src="images1/thumb5.jpg"/></a></td>

Once you have that, you can style it/them (in your stylesheet) like any other class of links, including pseudo classes, ex:


.inbox:link {
color:blue;
}
.inbox:visited {
color:purple;
}
.inbox:active {
color:red;
}

cybershot
10-07-2007, 05:01 PM
Ok, that worked. the link is showing now. thanks for that. One more question though. when i hover over the picture, it prints the entire link with the class name and everything. is there a way to hide that part of the title tag. maybe have a title for the pic then the link part hidden from the viewer?


<a href="images1/image5.JPG" rel="lightbox[map]" title="&lt;a class='map' href='http://www.cybersmods.com/modules.php?name=Downloads&amp;op=getit&amp;lid=2/'&gt;DOWNLOAD THIS MAP&lt;/a&gt;"><img border="0" src="images1/thumb5.jpg"/></a></td>

jscheuer1
10-07-2007, 06:17 PM
Here's one way:


<a href="images1/image5.JPG" rel="lightbox[map]"
title="&lt;a class='map' href='http://www.cybersmods.com/modules.php?name=Downloads&amp;op=getit&amp;lid=2/'&gt;DOWNLOAD THIS MAP&lt;/a&gt;"
onmousedown="this.title='<a class=\'inbox\' href=\'http://www.cybersmods.com/modules.php?name=Downloads&op=getit&lid=2/\'>DOWNLOAD THIS MAP</a>';"
onmouseout="this.title='<a class=\'inbox\' href=\'http://www.cybersmods.com/modules.php?name=Downloads&op=getit&lid=2/\'>DOWNLOAD THIS MAP</a>';"
onmouseover="this.title='Map #5';"><img border="0" src="images1/thumb5.jpg" alt=""></a>

This simpler method may work:


<a href="images1/image5.JPG" rel="lightbox[map]"
title="&lt;a class='map' href='http://www.cybersmods.com/modules.php?name=Downloads&amp;op=getit&amp;lid=2/'&gt;DOWNLOAD THIS MAP&lt;/a&gt;"><img
border="0" src="images1/thumb5.jpg" alt="" title="Map #5"></a>

But I'm not sure if all browsers will use the image's title for hover instead of the link's.

cybershot
10-07-2007, 06:46 PM
thanks alot. it worked very good.:)