Hello guys,
Below I present you some code which has completely been butchered by me.
$(".gig").hover(function() {
var id = $(this).attr("id");
var time = $(this).attr("title");
function () {
if (time > 0)
{
var answer = $('<div class="roll">Are you attending? <a href="' + id + '">Yes</a></div>').hide();
}
else
{
var answer = $('<div class="roll">Did you attend?<a href="' + id + '">Yes</a> </div>').hide();
}
answer.appendTo($(this)).fadeIn("fast");
}
function () {
$(this).find("div:last").fadeOut("fast", function() {
$(this).remove()
});
}
});
I know, it is terrible. It basically is like pseudocode now. Could anyone help me to re-write my mess into actually functioning code?
Basically for every class named div, it should append the variable answer onto the end of this div, and on mouseout, remove the variable answer. The variable time will be fetched from the title of the rollover div, and thus affect what is shown in the new div that is added. The id of the .gig should simply be passed into the url.
The hover answer add/remove functions work on their own, but I am unable to place them into the new function with the if and new variables.
Thank you so much.