Get Y position of an element in an iframe
问题 I think this has been asked already, I have an iframe page where we have nearly 10 textfield's, whenever the user taps on any one of the textfield, I would like to know the Y position in that page. Is that possible? 回答1: This is untested, but should point you in the right direction. jQuery $(document).ready(function(){ var iframe = $('iframe'); var inputs = iframe.find('input'); $.each(inputs, function(){ $(this).click(function(){ console.log($(this).offset().top)); }) }) }) Vanilla