I've got this code that's changing a picture and additional link with it.
var imgSwap(pic, link){
$("#sampleimg")
.load(function () {
$(this).hide();
$('#indexPic').removeClass('loading');
$(this).fadeIn(500);
})
.error(function () {})
.attr({src : picArray[5]});
$("a.frontlink").attr("href", linkArray[0]);
$('#indexPic').addClass('loading');
}
$("#arcade-button").click(function () { imgSwap(picArray[0], linkArray[0])});
The code works when I run the hole thing after each button, but not when I try to call my own function and optional-parameters. Can't seem to find the flaw... A little help anyone ?