I am trying to change the position of the image inside the .fc-content
of fullcalendar without changing the content's position.
if ((event.title).toString() == "Present") {
eventElement.find("div.fc-content").prepend("<img src='" + event.imageurl + "' width='24' height='24' position = 'relative' float = 'right' bottom = '0'>");
}
else if ((event.title).toString() == "Absent"){
eventElement.find("div.fc-content").prepend("<img src='" + event.imageurl + "' width='24' height='24' position = 'relative' bottom = '0'>");
}
I have tried position = relative
, bottom = 0
, float = right
but nothing worked. I am trying to display the "cross" mark on the absent to bottom left of the cell, where as the "tick-check" mark on the present to the bottom right of the cell.
UPDATED:
The image is coming from the controller;
var presentEventList = from e in presentDates
select new
{
id = EnrollNumber,
title = "Present",
start = ((DateTime)e.Date).ToString("s"),
end = ((DateTime)e.Date).ToString("s"),
borderColor = "#ffffff",
color = "#07b419",
imageurl= "/images/checked.png",
allDay = false
};
var presentRows = presentEventList.ToArray();
var absentEventList = from e in absentDates
select new
{
id = EnrollNumber,
title = "Absent",
start = ((DateTime)e.Date).ToString("s"),
end = ((DateTime)e.Date).ToString("s"),
borderColor = "#ffffff",
color = "#fa0303",
imageurl = "/images/cross.png",
allDay = false
};
var absentRows = absentEventList.ToArray();
var completeList = (presentEventList.Concat(absentEventList).ToArray());
return Json(completeList, JsonRequestBehavior.AllowGet);