Hello everyone, i´m having a hard time understanding how to resolve a problem with my code. I think the problem is when the scene unloads, i have to do something when my code and i was hopping someone could help me. When the scene loads the first time, everything works great, i have a button event and when the user clicks on it the pictures fadeToggle. But if the user navigates to another scene and then returns, the pictures appear and fade quickly, and that´s not the behavior i´m expecting, below is my code:
function clickGaleria(hypeDocument, element, event
{
$("#appCoolpark").css('display','none');
$("#appStructures").css('display','none');
$("#websiteHotelLeiria").css('display','none');
$("#appEco").css('display','none');
var i = 0;
var stuff =["websiteCoolpark","appCoolpark","appStructures","websiteHotelLeiria","appEco"];
$("#iconNextRight").click(function()
{
i = (i+1)%stuff.length;
if(i>0)
{
$(hypeDocument.getElementById((stuff[i-1]))).fadeOut();
$(hypeDocument.getElementById((stuff[i]))).fadeToggle();
}
else
{
$(hypeDocument.getElementById("appEco")).fadeOut();
$(hypeDocument.getElementById("websiteCoolpark")).fadeIn();
}
});
}
Pls help, i´m stuck!!!.