This repository was archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwpsmc-script.js
More file actions
48 lines (36 loc) · 1.34 KB
/
wpsmc-script.js
File metadata and controls
48 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*jQuery('.wpsm-content').addClass('wpsm-content-hide');
jQuery('.wpsm-show, .wpsm-hide').removeClass('wpsm-content-hide');
jQuery('.wpsm-show').on('click', function(e) {
jQuery(this).next('.wpsm-content').removeClass('wpsm-content-hide');
jQuery(this).addClass('wpsm-content-hide');
e.preventDefault();
});
jQuery('.wpsm-hide').on('click', function(e) {
var wpsm = jQuery(this).parent('.wpsm-content');
wpsm.addClass('wpsm-content-hide');
wpsm.prev('.wpsm-show').removeClass('wpsm-content-hide');
e.preventDefault();
});
*/
/* -------------------------------------------------------------------------- */
jQuery('.wpsmc-content').addClass('wpsmc-content-hide');
jQuery('.wpsmc-show, .wpsmc-hide').removeClass('wpsmc-content-hide');
jQuery('.wpsmc-show').on('click', function(e) {
var id = jQuery(this).attr('id');
if( typeof id !== 'undefined' ) {
id = id + '_content';
jQuery('#' + id).removeClass('wpsmc-content-hide');
}
jQuery(this).addClass('wpsmc-content-hide');
e.preventDefault();
});
jQuery('.wpsmc-hide').on('click', function(e) {
var wpsm = jQuery(this).parent('.wpsmc-content');
wpsm.addClass('wpsmc-content-hide');
var id = jQuery(wpsm).attr('id');
if( typeof id !== 'undefined' ) {
var newid = id.replace(/_content/gi, '');
jQuery('#' + newid).removeClass('wpsmc-content-hide');
}
e.preventDefault();
});