user2212564
user2212564

Reputation: 261

Styling image title attributes as a caption?

[NEW]

From my findings, either way i can't use the "after or :before as it's not how my function will run. My update is that when you click on a link the div appears with the relevant image and title and the title is now stored in the caption-overlay div.

How do i get that title information to display IN the div?

Here is my updated link: http://jsfiddle.net/SGktV/26/

[OLD] I have the following code in this link: http://jsfiddle.net/SGktV/25/

That when you click on a link a hidden div fades in the image with the src and title attributes. My only concern is i know you can style the title attribute using :before and :after but i know that they do not work in IE 8. Has anyone found a solution or is there an alternative method i can use to show a caption related to the link clicked?

 content: attr(title);

Hope my code helps, Thanks!

Upvotes: 0

Views: 3681

Answers (2)

user2212564
user2212564

Reputation: 261

I have solved this without using :before and :after by doing this:

http://jsfiddle.net/SGktV/28/

Basically, i changed my line in my jQuery to read:

$("#hiddenPanel #caption-overlay").text($(this).attr("data-title"));

and added div tags in under the image tag:

 `<div id="caption-overlay"></div>`

Is this the right way to do this?

Upvotes: 0

Mohammad Mahdi Naderi
Mohammad Mahdi Naderi

Reputation: 3165

Update

IE8 only supports the content property if a !DOCTYPE is specified.


but you use content with CSS3 Pie.

you can use CSS3 with CSS3 Pie And it works in IE.

Upvotes: 1

Related Questions