• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Shiaupo
知识要善于积累,技术更需要总结。
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Web前端

html,javascript,css
Simple JavaScript Inheritance - javascript中的简单继承

摘要://Inspiredbybase2andPrototype(function(){varinitializing=false,fnTest=/xyz/.test(function(){xyz;})?/\b_super\b/:/.*/;//ThebaseClassimplementation(doesnothing)this.Class=function(){};//CreateanewClassthatinheritsfromthisclassClass.extend=function(prop){var_super=this.prototype;//Instantiateabaseclass 阅读全文
posted @ 2011-11-15 10:27 Shiaupo 阅读(378) 评论(0) 推荐(0)
判断滚动条是否到达底端

摘要:1 //取窗口滚动条高度2functiongetScrollTop(){3varscrollTop=0;4if(document.documentElement&&document.documentElement.scrollTop){5scrollTop=document.documentElement.scrollTop;6}7elseif(document.body){8scrollTop=document.body.scrollTop;9}10returnscrollTop;11}121314//取窗口可视范围的高度15functiongetClientHeight() 阅读全文
posted @ 2011-11-08 16:39 Shiaupo 阅读(506) 评论(0) 推荐(0)

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3