Since I will be storing the employees who are out on vacation and back at work in a database table, I need to call deleteImage($item,$unid) function on page load. Not sure how to.
This is the function that is called when the suitcase icon is clicked (suitcase=out on vacation)
$('ul.gallery > li').click(function(ev) {
var $item = $(this);
var $unid = $(this).attr('id');
var $target = $(ev.target);
if ($target.is('a.ui-icon-suitcase')) {
deleteImage($item,$unid);
} else if ($target.is('a.ui-icon-arrowreturnthick-1-w')) {
recycleImage($item,$unid);
}
return false;
});
$item = $(this), and unid is the employeeID. How can I pass $(this) without a clicky event?
There is also a droppable function :
$suitcase.droppable({
accept: '#gallery > li',
activeClass: 'ui-state-highlight',
drop: function(ev, ui) {
var $unid = $(ui.draggable).attr('id');
deleteImage(ui.draggable,$unid);
}
});
I am not sure if it will be even possible to call this function on page load. any help?