随笔分类 - 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
阅读全文
判断滚动条是否到达底端
摘要: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()
阅读全文
浙公网安备 33010602011771号