How can set the text color to last visited list item?


#1

I want to set the text color to last visited item in list… How can do that???


#2

Keep in mind, this is just HTML, CSS, and JS…simple css pseudo class will do the trick.

a.item:visited{}

#3

I want only for last visited item. Not all visited item.

I have list and list description page. After click on back. On list page should show last visited item with different color(Red).


#4

I have listing and list description. On click of list it will display description. Then, I click back and In listing page i want to set color to item text which i was clicked last.
Please reply…


#5

I would use a service to store the index of the clicked item. When you click, you update the service value. And when you go back to the list, you read that value (and make a comparison in the ng-repeat, if you use that) and set it to null so that it doesn’t color an item the next time you go on the page.


#6

Can you send code. because, i try. that is not working… Please send the code…


#7

I don’t know how you generate your list, but I made a quick codepen: http://codepen.io/akyh/pen/afjIo


#8

Thanks. I did that with the help of your code… :slight_smile: