If I understand correctly, when div.element1 is clicked on, you want find div.element1 on object2 and if it exists scroll to it. You can usee something like this:
$(".object1 > div").click(function (){
var class = $(this).attr("class");
if ($(".object2 > div." + class).length > 0){
var matchingDivOn2ndObject = $(".object2 > div." + class)[0];
$('html, body').animate({
scrollTop: matchingDivOn2ndObject.offset().top
}, 1000);
}
});
solved js: check if 2 elements has the same class and do something