Hello everyone, I have this function that toggles between two CSS classes and shows/hide div content on an html page.
I want to have this function to work on multiple divs, but I do not know how to expand the function. Currently the div holding the more content is called: moreContent.
What I have done is create individual function for each instance that I want to call it on a specific div.
Example: Lets say I have 5 articles on a page. I want to add a button under each article that show/hide the more div. Currently I have only on and to put it on all 5 I have to duplicate the function and change the names
of the classes.
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?