block_store.js
2.13 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
49
50
51
jQuery(document).ready(function () {
jQuery("#block-types-navigation a.previous").hide();
jQuery('.block-types-group').first().show( 'slide', { direction : 'down' }, 1000, function() {
jQuery('.block-types-group').first().addClass('active');
jQuery(".block-types-group.active + .block-types-group").addClass('next');
jQuery('#block-types-navigation a.previous').click(PreviousSlide);
jQuery('#block-types-navigation a.next').click(NextSlide);
});
firstBlockTypesGroup = jQuery(".block-types-group").first();
lastBlockTypesGroup = jQuery(".block-types-group").last();
});
function NextSlide() {
activeBlockTypesGroup = jQuery(".block-types-group.active");
nextBlockTypesGroup = jQuery(".block-types-group.next").first();
activeBlockTypesGroup.hide( 'slide', { direction : 'left' }, 1000);
nextBlockTypesGroup.show( 'slide', { direction : 'right' }, 1000, function() {
activeBlockTypesGroup.removeClass('active');
activeBlockTypesGroup.addClass('prev');
nextBlockTypesGroup.removeClass('next');
nextBlockTypesGroup.addClass('active');
jQuery(".block-types-group.active + .block-types-group").addClass('next');
activeBlockTypesGroup = jQuery(".block-types-group.active");
jQuery("#block-types-navigation a.previous").show();
if ( activeBlockTypesGroup.is( lastBlockTypesGroup ) ) {
jQuery("#block-types-navigation a.next").hide();
}
});
}
function PreviousSlide() {
activeBlockTypesGroup = jQuery(".block-types-group.active");
previousBlockTypesGroup = jQuery(".block-types-group.prev").last();
activeBlockTypesGroup.hide( 'slide', { direction : 'right' }, 1000 );
previousBlockTypesGroup.show( 'slide', { direction : 'left' }, 1000, function() {
activeBlockTypesGroup.removeClass('active');
activeBlockTypesGroup.addClass('next');
previousBlockTypesGroup.removeClass('prev');
previousBlockTypesGroup.addClass('active');
activeBlockTypesGroup = jQuery(".block-types-group.active");
jQuery("#block-types-navigation a.next").show();
if ( activeBlockTypesGroup.is( firstBlockTypesGroup ) ) {
jQuery("#block-types-navigation a.previous").hide();
}
});
}