Team:Gothenburg/Calendar

From 2014.igem.org

(Difference between revisions)
m
m (added functionallity)
Line 1,456: Line 1,456:
/*hide popup*/
/*hide popup*/
-
/*
+
jQuery(document).click(function(event) {
-
jQuery(document).on('click', function(event) {
+
-
 
+
-
   if (!jQuery(event.target).closest('.date').length) {
+
   if (!jQuery(event.target).closest('.date').length) { //should have more cases
     box.fadeOut();
     box.fadeOut();
   }
   }
-
 
 
});
});
-
*/
 
-
jQuery(document).click(function(event) {
 
-
 
 
-
  if (!jQuery(event.target).closest('.date').length) {
 
-
    box.fadeOut();
 
-
  }
 
-
 
 
-
});
+
/*jQuery( ".date" ).click(function() {
 +
    showContentOf(this.id);
-
jQuery( ".date" ).click(function() {
+
});*/
 +
 
 +
$( ".date" ).click(function(event) {
 +
    var currMonth = $(event.target).parentsUntil("#calendar").last().attr('id');
 +
    var _currDate = $(event.target).parentsUntil(".week");
 +
 
 +
    /*sets currDate to the object of the current date, even if a children is clicked*/
 +
    if(_currDate.length){
 +
        var currDate = $(event.target).parents().eq(_currDate.length - 1);
 +
    } else {
 +
        var currDate = $(event.target);
 +
    }
 +
 
 +
    if ( currDate.hasClass( "prev-month" ) ) {
 +
        goToMonth(currMonth, 'prev');
 +
    } else if ( currDate.hasClass( "next-month" ) ) {
 +
        goToMonth(currMonth, 'next');
 +
    } else {
 +
        showContentOf(this.id);
 +
    }
-
    showContentOf(this.id);
 
});
});
Line 1,494: Line 1,503:
     box.fadeIn();
     box.fadeIn();
 +
}
 +
 +
function goToMonth(currMonth, targetMonth) {
 +
    if (targetMonth == 'prev') {
 +
       
 +
        if (currMonth == 'july') {
 +
            location.href = "#june";
 +
        } else if (currMonth == 'august') {
 +
            location.href = "#july";
 +
        } else if (currMonth == 'september') {
 +
            location.href = "#august";
 +
        }
 +
 +
    } else {
 +
 +
        if (currMonth == 'june') {
 +
            location.href = "#july";
 +
        } else if (currMonth == 'july') {
 +
            location.href = "#august";
 +
        } else if (currMonth == 'august') {
 +
            location.href = "#september";
 +
        }
 +
 +
    }
}
}
     </script>
     </script>

Revision as of 19:55, 7 August 2014

TemplateUp

Click a date with posts to show the content, or click outside this box to close it!

26

  • Title one
  • Title two

27

  • Title one
  • Title two

28

  • Title one
  • Title two

29

  • Title one
  • Title two

30

  • Title one
  • Title two

31

  • Title one
  • Title two

1

  • Title one
  • Title two

2

  • Title one
  • Title two

3

  • Title one
  • Title two

4

  • Title one
  • Title two

5

  • Title one
  • Title two

6

  • Title one
  • Title two

7

  • Title one
  • Title two

8

  • Title one
  • Title two

9

  • Title one
  • Title two

10

  • Title one
  • Title two

11

  • Title one
  • Title two

12

  • Title one
  • Title two

13

  • Title one
  • Title two

14

  • Title one
  • Title two

15

  • Title one
  • Title two

16

  • Title one
  • Title two

17

  • Title one
  • Title two

18

  • Title one
  • Title two

19

  • Title one
  • Title two

20

  • Title one
  • Title two

21

  • Title one
  • Title two

22

  • Title one
  • Title two

23

  • Title one
  • Title two

24

  • Title one
  • Title two

25

  • Title one
  • Title two

26

  • Title one
  • Title two

27

  • Title one
  • Title two

28

  • Title one
  • Title two

29

  • Title one
  • Title two

30

  • Title one
  • Title two

1

  • Title one
  • Title two

2

  • Title one
  • Title two

3

  • Title one
  • Title two

4

  • Title one
  • Title two

5

  • Title one
  • Title two

6

  • Title one
  • Title two

30

  • Title one
  • Title two

1

  • Title one
  • Title two

2

  • Title one
  • Title two

3

  • Title one
  • Title two

4

  • Title one
  • Title two

5

  • Title one
  • Title two

6

  • Title one
  • Title two

7

  • Title one
  • Title two

8

  • Title one
  • Title two

9

  • Title one
  • Title two

10

  • Title one
  • Title two

11

  • Title one
  • Title two

12

  • Title one
  • Title two

13

  • Title one
  • Title two

14

  • Title one
  • Title two

15

  • Title one
  • Title two

16

  • Title one
  • Title two

17

  • Title one
  • Title two

18

  • Title one
  • Title two

19

  • Title one
  • Title two

20

  • Title one
  • Title two

21

  • Title one
  • Title two

22

  • Title one
  • Title two

23

  • Title one
  • Title two

24

  • Title one
  • Title two

25

  • Title one
  • Title two

26

  • Title one
  • Title two

27

  • Title one
  • Title two

28

  • Title one
  • Title two

29

  • Title one
  • Title two

30

  • Title one
  • Title two

31

  • Title one
  • Title two

1

  • Title one
  • Title two

2

  • Title one
  • Title two

3

  • Title one
  • Title two

28

  • Title one
  • Title two

29

  • Title one
  • Title two

30

  • Title one
  • Title two

31

  • Title one
  • Title two

1

  • Title one
  • Title two

2

  • Title one
  • Title two

3

  • Title one
  • Title two

4

  • Title one
  • Title two

5

  • Title one
  • Title two

6

  • Title one
  • Title two

7

  • Title one
  • Title two

8

  • Title one
  • Title two

9

  • Title one
  • Title two

10

  • Title one
  • Title two

11

  • Title one
  • Title two

12

  • Title one
  • Title two

13

  • Title one
  • Title two

14

  • Title one
  • Title two

15

  • Title one
  • Title two

16

  • Title one
  • Title two

17

  • Title one
  • Title two

18

  • Title one
  • Title two

19

  • Title one
  • Title two

20

  • Title one
  • Title two

21

  • Title one
  • Title two

22

  • Title one
  • Title two

23

  • Title one
  • Title two

24

  • Title one
  • Title two

25

  • Title one
  • Title two

26

  • Title one
  • Title two

27

  • Title one
  • Title two

28

  • Title one
  • Title two

29

  • Title one
  • Title two

30

  • Title one
  • Title two

31

  • Title one
  • Title two

1

  • Title one
  • Title two

2

  • Title one
  • Title two

3

  • Title one
  • Title two

4

  • Title one
  • Title two

5

  • Title one
  • Title two

6

  • Title one
  • Title two

7

  • Title one
  • Title two

8

  • Title one
  • Title two

9

  • Title one
  • Title two

10

  • Title one
  • Title two

11

  • Title one
  • Title two

12

  • Title one
  • Title two

13

  • Title one
  • Title two

14

  • Title one
  • Title two

15

  • Title one
  • Title two

16

  • Title one
  • Title two

17

  • Title one
  • Title two

18

  • Title one
  • Title two

19

  • Title one
  • Title two

20

  • Title one
  • Title two

21

  • Title one
  • Title two

22

  • Title one
  • Title two

23

  • Title one
  • Title two

24

  • Title one
  • Title two

25

  • Title one
  • Title two

26

  • Title one
  • Title two

27

  • Title one
  • Title two

28

  • Title one
  • Title two

29

  • Title one
  • Title two

30

  • Title one
  • Title two

1

  • Title one
  • Title two

2

  • Title one
  • Title two

3

  • Title one
  • Title two

4

  • Title one
  • Title two

5

  • Title one
  • Title two