I have a function in my javascript file:
function hoverWidgetOn (param, value) {
var element = $("*[data-label]"),
config = {
'display':'inline',
'position':'absolute',
'top':'6.5em',
'padding' : '0.5em',
'background-color':'#383838',
'color':'white',
'font-size' : '0.8em',
'opacity' : '0.9',
'param' : 'value'
},
label = $(this).attr("data-label"),
d = document.createElement('span'),
t = document.createTextNode(label);
d.className = "labelShow";
$(this).append(d);
$('.labelShow').append(t).css(config);
}
What I want it to do is to add param and value to my variable config when calling function
element.on('mouseenter', hoverWidgetOn('background-color', 'red'))
so the user of this application won't have to change my javascript file in order to change label's look while calling this function in other javascript file, but no matter how I try, this doesn't work... I would be glad if anyone can help me.