次のコードを使用しているスクリプトでは、ポップアップウィンドウを画面の中央に配置するために使用されます。
Y
クリックした項目と位置が同じになるように、これを変更する必要があります。そのため、アイテムをクリックすると、クリックしたアイテムと同じ高さにポップアップが表示されます。私はjqueryについての手がかりがなく、2時間試しても役に立ちませんでした。任意の助けをいただければ幸いです
編集が必要な行をマークしました。
switch(a)
{
case 'postdetails':
case 'userdetails':
$('#reputation-popup').addClass('normal-popup');
targetleft = ($(window).width() - $('#reputation-popup').outerWidth()) / 2;
targettop = ($(window).height() - $('#reputation-popup').outerHeight()) / 2;
/////// THE LINE ABOVE THIS IS THE ONE I NEED TO EDIT!!!! //////////
break;
case 'newpopup':
$('#reputation-popup').addClass('new-popup');
targetleft = ($(window).width() - $('#reputation-popup').outerWidth()) / 2;
targettop = ($(window).height() - $('#reputation-popup').outerHeight()) / 2;
break;
default:
$('#reputation-popup').addClass('small-popup');
// Center popup relative to clicked coordinate
targetleft = c.pageX - $('#reputation-popup').outerWidth() / 2;
// Popup can not be too close or behind the right border of the screen
targetleft = Math.min (targetleft, $(document).width() - 20 - $('#reputation-popup').outerWidth());
targetleft = Math.max (targetleft, 20);
targettop = c.pageY + 10;
break;
}