I have a table which its outputting about 1k records.
since there are many records I have to click down to view them all, but when I do scroll down and I click on the name it shows the output at the same place on top.
How can I get it that it can show the text next to where I click in on the browser without scrolling up?
I made a http://jsfiddle.net/xhow5n44/ . I'm not sure if this is something that will be easier to make it happen with css or javascript.
<script language="JavaScript">
$(document).ready(function() {
$('a').click(function () {
var StateName = $(this).attr("detail");
$('#maintext').show();
$('#output').html(StateName);
});
});
</script>
<table class="tablecolors">
<thead><th scope="col">Name</th><th scope="col">Ext:</th><th scope="col">Title </th></thead>
<tbody>
<cfloop query="Corporate" >
<cfoutput>
<tr>
<td ><a id="showdata" detail="Cell:<cfif #Corporate.emp_cell# eq ""> No Number<cfelse>#Corporate.emp_cell# </cfif>
<br/>test">
#Corporate.emp_namefirst#
<td ><div align="center">#Corporate.emp_ext#</div></td>
<td > <cfif #Corporate.title_id# is not 19>#Corporate.title_name#</cfif> </td>
</tr>
</cfoutput>
</cfloop>
</tbody>
</table>
<h2 id="maintext" style="display: none;">Here We will Display </h2>
<div id="output"></div>