проверял и для клееных постмерджем постов, и для добавленных аяксом без склейки после моего предыдущего или чужого поста.
поставил код на ближайший не перезаписываемый элемент выше (придумал не сам, подсказали).
годный вариант? пойдет?
или слишком большая нагрузка получается?
Код: Выделить всё
$('#posts').on('mouseenter', '.postprofile', function() {
if ($(window).width() > 843) {
$(this).find('.avatar img').stop(true, true).css({margin: '-20px 0 -40px 0'}).animate({margin: '0'},300);
$(this).find('.profile-custom-field').stop(true, true).show(300);
$(this).find('.profile-joined').stop(true, true).show(300);
$(this).find('.profile-rank').stop(true, true).show(300);
$(this).find('.profile-posts').stop(true, true).show(300);
var txt1 = '<span id="temp_added_text" style="display: block; padding-left: 70px;"><br/>▲<br/><br/></span>';
$(this).find('.profile-contact').append(txt1);
}
})
$('#posts').on('mouseleave', '.postprofile', function() {
if ($(window).width() > 843) {
$(this).find('.avatar img').stop(true, true).css({margin: '-20px 0 -40px 0'});
$(this).find('.profile-custom-field').stop(true, true).hide();
$(this).find('.profile-joined').stop(true, true).hide();
$(this).find('.profile-rank').stop(true, true).hide();
$(this).find('.profile-posts').stop(true, true).hide();
$(this).find('#temp_added_text').remove();
}
})
старый вариант, для себя
Код: Выделить всё
$('.postprofile').hover(function() {
if ($(window).width() > 843) {
$(this).find('.avatar img').stop(true, true).css({margin: '-20px 0 -40px 0'}).animate({margin: '0'},300);
$(this).find('.profile-custom-field').stop(true, true).show(300);
$(this).find('.profile-joined').stop(true, true).show(300);
$(this).find('.profile-rank').stop(true, true).show(300);
$(this).find('.profile-posts').stop(true, true).show(300);
var txt1 = '<span id="temp_added_text" style="display: block; padding-left: 70px;"><br/>▲<br/><br/></span>';
$(this).find('.profile-contact').append(txt1);
}
}, function() {
if ($(window).width() > 843) {
$(this).find('.avatar img').stop(true, true).css({margin: '-20px 0 -40px 0'});
$(this).find('.profile-custom-field').stop(true, true).hide();
$(this).find('.profile-joined').stop(true, true).hide();
$(this).find('.profile-rank').stop(true, true).hide();
$(this).find('.profile-posts').stop(true, true).hide();
$(this).find('#temp_added_text').remove();
}
});