function showHelper (id,text) { let pos=$("#"+id).offset(); let posTop = pos.top; let posLeft = pos.left; let posRight = posLeft+$("#"+id).width()+32; $("#helperPopup").html("

"+text+"

"); if ($( document ).width() < (posRight+$( "#helperPopup" ).width())) { posTop = posTop+$("#"+id).height()+25; posRight = posLeft+$("#"+id).width()-$("#helperPopup").width()+26; $("#helperPopup").css({marginTop: posTop, marginLeft: posRight}); $("#helperPopup").css("background-image","url('assets/images/helperBackgroung_up.png')"); $("#helperPopup").css("background-position","-16px -12px"); $("#helperPopup p").css("padding-top","11px"); $("#helperPopup p").css("padding-left","12px"); } else { $("#helperPopup").css({marginTop: posTop, marginLeft: posRight}); $("#helperPopup").css("background-image","url('assets/images/helperBackgroung.png')"); $("#helperPopup").css("background-position","-10px 0px"); $("#helperPopup p").css("padding-top","7px"); $("#helperPopup p").css("padding-left","20px"); } $("#helperPopup").css('display','block'); } $(document).on('mouseover', '#child-id-number', function () { showHelper('child-id-number','Gyermek TAJ száma'); }); ;$(document).on('mouseout', '#child-id-number', function () { $('#helperPopup').css('display','none'); }); $(document).on('mouseover', '#child-mother-name', function () { showHelper('child-mother-name','Édesanyja lánykori neve'); }); ;$(document).on('mouseout', '#child-mother-name', function () { $('#helperPopup').css('display','none'); }); $(document).on('mouseover', '#attendant-mother-name', function () { showHelper('attendant-mother-name','Édesanyja lánykori neve'); }); ;$(document).on('mouseout', '#attendant-mother-name', function () { $('#helperPopup').css('display','none'); }); $(document).on('mouseover', '#attendant-volunteer', function () { showHelper('attendant-volunteer','Önkéntes a kísérő, amennyiben szabadsága terhére vállal kísérői feladatokat'); }); ;$(document).on('mouseout', '#attendant-volunteer', function () { $('#helperPopup').css('display','none'); });