Created
November 8, 2017 18:58
-
-
Save DrewDouglass/ef80da4be2bafe8f7ca514f0f94af9f2 to your computer and use it in GitHub Desktop.
FullCalendar alternate calendar colors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Globla variable outside of all functions | |
var altColor = 1; | |
//Global function | |
function isEven(n) { | |
return n % 2 == 0; | |
} | |
//This goes inside the full calendar call | |
eventRender: function(event, element) { | |
if(isEven(altColor)) { | |
$(element).css("background-color", "red"); | |
} | |
else { | |
$(element).css("background-color", "blue"); | |
} | |
altColor++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment