hi have this method in JS:
This one is for the button im using till now.
$('#balpha').click(function(e) {
e.preventDefault();
if (alphasw < 1) { alphasw = 1;}
else { alphasw = 0;}
$('.alpha').each(function(){
/* element specific data object*/
var data= $(this).data('maphilight') ;
if (alphasw < 1) {
data.alwaysOn = true;}
else{
data.alwaysOn = false;}
$(this).trigger('alwaysOn.maphilight')
});
});
For some reason i have to make the same call with a input type="image" so I add onClick="alphabutton();" on input propertis and did next changes in the method.
function alphabutton(e) {
e.preventDefault();
if (alphasw < 1) { alphasw = 1;}
else { alphasw = 0;}
$('.alpha').each(function(){
/* element specific data object*/
var data= $(this).data('maphilight') ;
if (alphasw < 1) {
data.alwaysOn = true;}
else{
data.alwaysOn = false;}
$(this).trigger('alwaysOn.maphilight')
});
}
I cant see what is wrong, any advice?
I found a solution for my problem, probably I tried to make the things harder.
<input type="image" src="img/Buttons/alpha.png" id="balpha"/>
I just added id to the input tag, so I dont have to modify the first method.