Sorry if the title is not accurate - I could not figure out how to write it.
I have several widgets with the same class <div class="widget"></div>- each widget has a title and content, structured as follows:
<div class="widget">
<div class="widget-title">Title</div>
<div class="widget-content">Content Here</div>
</div>
The "widget content" is hidden, and when you click on the widget title, the content appears, and the class is applied to the widget type, changing it to "widget-view-open". This part works, and the widget contents also open.
The problem is that it opens the contents of the widget to ALL widgets. It should only open the widget content in the specific widget where the title was clicked, and not ALL of them. I'm not sure I should use the correct syntax, so it only opens the widget content of a particular widget that the user clicks on the title.
Here is the code that I still have:
$('.widget').find('.widget-title').click(function() {
$('.widget-content').show('slow', function() {
});
$('.widget').find('.widget-title').addClass("open");
});
Can someone provide a working example? Thanks
source
share