Too easy but failed - get the top position of each td after AJAX response
Just give me a little hint
how can I get
alert('top=='+evto);
[index.php]---------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Loop through an array using jQuery</title>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var dataj ={'ss':'ss', 'tss':'tss'};
$.ajax({
type: "POST",
url: "prc_treach.php",
data: dataj,
cache: false,
success: function(html) {
$("
#right_td").html(html);
}
});//ajax
$("
#right_td").delegate('
#tbl_write tr', each(function() {
var ev = $(this).offset();
var evto = ev.top;
alert('top=='+evto);
});//#tbl
});//doc
</script>
</head>
<body>
<div id="
right_td"></div>
</body>
</html>
[prc_treach.php]-----------------------------------------
<?php
echo '<table id="tbl_write">';
echo '<tr><td>fefefe</td><td>efefe</td><td>efefe</td></tr>';
echo '<tr><td>fefefe</td><td>efefe</td><td>efefe</td></tr>';
echo '<tr><td>fefefe</td><td>efefe</td><td>efefe</td></tr>';
echo '<tr><td>fefefe</td><td>efefe</td><td>efefe</td></tr>';
echo '</table>';
?>