I have the following code working:
$(document).ready(function () {
$(".b0").hover(function () {
var src = $(this).attr('data');
var href = $(this).attr('href');
$("#imagen").attr('src', src);
$("#vinculo").attr('href', href);
});
$(".b1").hover(function () {
var src = $(this).attr('data');
var href = $(this).attr('href');
$("#imagen").attr('src', src);
$("#vinculo").attr('href', href);
});
})
But I can't simplify it with a function. I tried several times and ways...
$('.b0, .b1').hover(...Or better yet - put the same class on both elements