Jquery:
$(document).ready(function () {
$('#myfirstDiv').click(function () {
$('#seconDiv').fadeIn("fast");
});
$('#closeBtn').click(function () {
$('#seconDiv').fadeOut("fast");
});
});
there is multiple usage of these functions in my site, with different ids for Div and Buttons.
How could I generalize these functions for every Div and Button?
Here’s a plugin that takes in the second div and the button to close it:
DEMO