html
<h3 id="top">页面上方</h3> <h3 id="center">页面中间</h3> <h3 id="bottom">页面下方</h3>
js
<script>
$("#top").click(function() {
showMsg('我是上面', 'top');
});
$("#center").click(function() {
showMsg('我是中间', 'center');
});
$("#bottom").click(function() {
showMsg('我是下面', 'bottom');
});
</script>在需要的地方调用,设置参数就OK了
showMsg(text,position);