I have a content type in which there is a cck image field and now I have listed the images with the node title as a block by views.

Now I want to show the node title when user mouseovers the image. I think I can implement it by views itself but I don't know how to do it?.

Can anyone help?

link|improve this question

6% accept rate
feedback

migrated from stackoverflow.com Jun 11 '11 at 0:25

This question came from our site for professional and enthusiast programmers.

1 Answer

I don't think you can do that using views. However you can "hack" a way to add title element to a div, for instance.

go to your view config page

add a node: title field.

edit the node: title field.

tick "Exclude from display" and "strip HTML tags"

click save

move the title node to top of the fields.

edit your image field and tick "Rewrite the output of this field"

a textarea appears. write this code in the textarea

<div title="[title]">[image]</span>

Note: the [fields] are tokens. If you already have a title field, you don't need to exlude it, you can re-use it.

if the image displays another title its because the module automatically sets a title tag to the image. You can either change this tag with javascript:

document.getElementById("idElement").setAttribute("Title", "title");

or edit your image module and set the page title to be your title tag.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.