Web Design Forum: Change link attributes with CSS? - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Change link attributes with CSS?

#1 User is offline   jg-interactive 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 31-January 12
  • Reputation: 0
  • Gender:Male
  • Location:Birmingham, UK
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 31 January 2012 - 03:16 PM

Hello everyone, I am new to the forums so I hope I am posting this in the right place.

I am building a portfolio website for a client and they have requested that there is a lightbox image gallery within the website, They also asked me to integrate wordpress into the site for them.

So what I have done is create a static HTML site which powered by Wordpress' back end and have included all the content into the site via PHP Include, Sounds good so far.

When it came to implementing the gallery, I decided the best thing to do would be to create a page in wordpress where the client could just post tumbnails, then when you click the tumbnail it opens up lightbox and shows the full image.

The problem I am having is that Lightbox requires me to put an attribute into the link in order for the link to open lightbox.

I have tried many different things but none of them are working, I thought about finding the file that Wordpress uses to create links for the images and re-code it to include the attribute on images, but I have had no luck.

So my question is, is it possible to do this with CSS?

The attribute I need to include is
rel="lightbox"


So any links generated need to look something along the lines of
<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>


Is this possible? if so would any of you be able to give me any examples?
Thank you very much for ready this and thank you in advance for any replies, Once again I hope I posted this is the right forum and I hope to be a very active member of your community!

Regards,
Jay
0

#2 User is online   BlueDreamer 

  • Web Guru
  • Group: Moderators
  • Posts: 5,804
  • Joined: 23-October 07
  • Reputation: 202
  • Gender:Male
  • Location:Northampton (where?)
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 31 January 2012 - 08:05 PM

In your Javascript have you tried initialting the lightbox for all images contained in links? Something like:

$("a:has(img)").lightbox();

0

#3 User is offline   jg-interactive 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 31-January 12
  • Reputation: 0
  • Gender:Male
  • Location:Birmingham, UK
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 01 February 2012 - 03:23 PM

I haven't tried that, I know nothing about Javascript, will give it a go though, thank you for the reply!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users