You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I've been trying out Galleria and like it overall, but came across something unusual. See this code fragment:
$("#media").click(function() {
console.log("click");
var executed = false;
Galleria.ready(function(options) {
console.log(this.getIndex());
if (!executed) {
mediaAction(this.getIndex());
executed = true;
}
});
});
I noticed that the mediaAction function was being called TWICE. The 'click' console message only shows up once for a single click, but the console.log message in Galleria.ready block are duplicated. Both calls return 0.
I've worked around the problem by adding the lines containing the 'executed' variable, which has stopped the duplicate function call. However, not clear why that was necessary in the first place. Can anybody shed any light on this one please?
Many thanks, Richard
The text was updated successfully, but these errors were encountered:
Hi. I've been trying out Galleria and like it overall, but came across something unusual. See this code fragment:
$("#media").click(function() {
console.log("click");
var executed = false;
Galleria.ready(function(options) {
console.log(this.getIndex());
if (!executed) {
mediaAction(this.getIndex());
executed = true;
}
});
});
I noticed that the mediaAction function was being called TWICE. The 'click' console message only shows up once for a single click, but the console.log message in Galleria.ready block are duplicated. Both calls return 0.
I've worked around the problem by adding the lines containing the 'executed' variable, which has stopped the duplicate function call. However, not clear why that was necessary in the first place. Can anybody shed any light on this one please?
Many thanks, Richard
The text was updated successfully, but these errors were encountered: