You are replacing a string that doesnt exist.
When I get you right, all images have an initial source url of "image-220x466.gif". In your function, you replace this string's '270' parts with '572', which can not work since there is no "270" in "image-220x466.gif".
I am not sure why you cant just set the source directly, like so:
element.attr('src', 'image-270x572.gif');
EDIT
change __ x __ for each resolution:
$('.slider .img').each(function() {
var element = $(this),
src = $(this).attr('src'),
newSrc;
if ( $(window).width() > 1199) {
newSrc = src.replace('220', '270');
newSrc = src.replace('466', '572');
}
else if () {
}
else if () {
}
element.attr('src', newSrc);
});
There seems to be some lack of understanding what .replace() does. In brief, replace takes two parameters. The first one is the string that shall be replaced and the second one defines what shall be inserted instead.
So if your string is "220x466" you can replace the 220 with something else, like so:
"220x466".replace("220", "270");
will will output "270x466"