История изменений
Исправление drull, (текущая версия) :
Тогда как-то так:
$('div.title > a').each(function(idx,elem){
$(elem).mouseover(function(){
$.ajax({type: «GET», url: $(this).attr('href')})
.done(function(msg){
msg = $(msg);
msg = msg.find('a').filter(function(){return ($(this).text() === «Ссылка» && $(this).attr('href') == $(elem).attr('href')); }).parents('article').find('.msg_body.message-w-userpic');
popup = $('<div class=«2ch_popup»>' + msg.html() + '</div>');
$('body').remove('.2ch_popup');
$('body').append(popup);
$('.2ch_popup').css('z-index', '9999')
.css('position', 'absolute')
.css('top', $(elem).offset().top+'px')
.css('left', ($(elem).offset().left+$(elem).width()+20)+'px')
.css('background-color','#101010')
.css('width', '600px')
.css('border-radius', '5px')
.css('padding', '5px');
})
})
.mouseout(function(){setTimeout(function(){$('.2ch_popup').remove();}, 3000); })
});
Выглядит так: http://clip2net.com/clip/m160315/1359040829-clip-80kb.png
Пост отредактировал.
Исправление drull, :
Тогда как-то так:
$('div.title > a').each(function(idx,elem){
$(elem).mouseover(function(){
$.ajax({type: «GET», url: $(this).attr('href')})
.done(function(msg){
msg = $(msg);
msg = msg.find('a').filter(function(){return ($(this).text() === «Ссылка» && $(this).attr('href') == $(elem).attr('href')); }).parents('article').find('.msg_body.message-w-userpic');
popup = $('<div class=«2ch_popup»>' + msg.html() + '</div>');
$('body').remove('.2ch_popup');
$('body').append(popup);
$('.2ch_popup').css('z-index', '9999')
.css('position', 'absolute')
.css('top', $(elem).offset().top+'px')
.css('left', ($(elem).offset().left+$(elem).width()+20)+'px')
.css('background-color','#101010')
.css('width', '600px')
.css('border-radius', '5px')
.css('padding', '5px');
})
})
.mouseout(function(){setTimeout(function(){$('.2ch_popup').remove();}, 3000); })
});
Выглядит так: http://clip2net.com/clip/m160315/1359040829-clip-80kb.png
Исходная версия drull, :
Тогда как-то так:
$('div.title > a').each(function(idx,elem){
$(elem).mouseover(function(){
$.ajax({type: «GET», url: $(this).attr('href')})
.done(function(msg){
msg = $(msg);
msg = msg.find('a').filter(function(){return ($(this).text() === «Ссылка» && $(this).attr('href') == $(elem).attr('href')); }).parents('article').find('.msg_body.message-w-userpic');
popup = $('<div class=«2ch_popup»>' + msg.html() + '</div>');
$('body').remove('.2ch_popup');
$('body').append(popup);
$('.2ch_popup').css('z-index', '9999')
.css('position', 'absolute')
.css('top', $(elem).offset().top+'px')
.css('left', ($(elem).offset().left+$(elem).width()+20)+'px')
.css('background-color','#101010')
.css('width', '600px')
.css('border-radius', '5px')
.css('padding', '5px');
})
})
.mouseout(function(){setTimeout(function(){$('.2ch_popup').remove();}, 5000); })
});
Выглядит так: http://clip2net.com/clip/m160315/1359040829-clip-80kb.png