i have this piece of code:
getOptionText: function(elem, value, config){
var text = $(elem).innerHTML;
var configType = this.getConfigValue(config, 'type', false);
if (!configType) {
return text;
}
switch (config.type) {
case 'custom_images':
var image = this.getConfigValue(config, 'images/' + value, false);
if (image) {
text = '<img class="mytest" src="' + image + '" alt="' + text +'" />';
jQuery(".mytest").hover(function(){
jQuery(this).addClass('big-red-box');
},function(){
jQuery(this).removeClass('big-red-box');});
}
break;
how I can add the image variable on hover? So all i want is when a customer put the mouse over the small images to display the full image.
Thank you
Edit:
switch (config.type) {
case 'custom_images':
var image = this.getConfigValue(config, 'images/' + value, false);
if (image) {
text = '<img class="mytest" src="' + image + '" alt="' + text +'" />';
$img = $('<img class="mytest" src="' + image + '" alt="' + text + '" />');
$img.hover(function () {
jQuery(this).addClass('big-red-box');
}, function () {
jQuery(this).removeClass('big-red-box');
});
jQuery("mytest").append(text);
}
break;