jquery 设置div在浏览器的位置


<script type="text/javascript">
var offset = $("#health_alert").offset();
var alert_top = offset.top;
var window_height =$(window).height();
var alert_hight = $("#health_alert").outerHeight();
var alert_top = ( window_height - alert_hight )/ 2;
$("#health_alert").offset({ top: alert_top});
//alert(alert_hight);
</script>

http://api.jquery.com/height/

http://api.jquery.com/offset/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM