WEB开发网
开发学院网页设计JavaScript Prototype实战教程----15.ObjectRange 阅读

Prototype实战教程----15.ObjectRange

 2010-09-14 13:10:04 来源:WEB开发网   
核心提示:<script src="prototype.js"></script><div id="div1" style="font-size:20px;font-weight:bold">ObjectRange</div&g

<script src="prototype.js"></script>
<div id="div1" style="font-size:20px;font-weight:bold">
ObjectRange
</div>
<script>
var range = $R(1, 10, false);
var range2 = $R(1, 10, true);
  
alert(range.merge(range2));
// true
alert(range.include(1));
// true
alert(range.include(5));
// true
alert(range.include(10));
  
// true
alert(range2.include(1));
// true
alert(range2.include(5));
// false
alert(range2.include(10));
</script>

Tags:Prototype 实战 教程

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接