Im using ddSlick plugin for jQuery and the method onSelected should only run when I have chosen an option from the created Dropdown.
Only problem is that the following code I have seems to run the onSelected as soon as the page loads.
Can anyone point me in the right direction?
$('#flag').ddslick({
imagePosition:"left",
background:"none",
width:"66px",
onSelected: function(data){
var chosenCountry = data.selectedData.value;
chosenCountry = chosenCountry.toLowerCase();
if(data.selectedIndex > 0) {
if( new_url[1] in oc(['de', 'es','fr','it']) ) {
console.log("translated pages");
}
} else {
console.log("English site");
}
}
});
Thanks
I have invented a solution after hours of figuring out whats the problem.
I directly change something on the code.
Note: you need to use the unminified version to follow this instructions.
on line 220
find:
change it to:
Line 270
find:
change it to:
And finally on line 146
find
then change it to
Hope that helps!