Closest gets you the closest element matching the selector higher up the hierarchy. Docs
From the docs:
For each element in the set, get the first element that matches the
selector by testing the element itself and traversing up through its
ancestors in the DOM tree.
In your case, the tr
matching .obrazok
is not higher in the hierarchy when viewed from the clicked link.
You will need something that traverses the DOM and gets you the nearest element in the DOM. This answer I posted for another question I believe should help: https://stackoverflow.com/a/12873187/921204
You can use it like:
$(".zmenit-poziciu").click(function() {
var img = nextInDOM('.obrazok', $(this));
alert(img);
return false
});