
Originally Posted by
Iconic_creator
Thanks mate, this is exactly what I needed. But I had a readLess CSS class that shows on mouse image and a readless graphic when the button is clicked.
Example: The bottom has four state: ReadMore, readMore Hover, readLess and ReadLess Hover.
So when I mouse over the read more button, it dims when I click on it, the button than shows the ReadLess graphic, finally when I hover over readless it dims also and back to read more when clicked.
I guess in a nutshell with your example, how do I also toggle the class between readmore and readless?
Thanks!!
IC
I figured this out, I don't know much about JQuery or JS.
But I simply added the toggle class to the example like this:
Final Code:
Code:
$(document).ready(function() {
$('.readMore').each(function(i) {
$(this).on('click', function() {
$(this).toggleClass('readLess');
$(this).next().toggle();
});
});
});
Thanks again!
Bookmarks