2007-04-11

Ext - heart class Element

关键字: Ext
xml 代码
  1. <html>  
  2. <head>  
  3.   
  4. <title>Ext lession 1 - heat class Elementtitle>  
  5. <link rel="stylesheet" type="text/css" href="http://www.agideo.com/lib/ext-1.0-alpha3/resources/css/ext-all.css"/>  
  6. <link rel="stylesheet" type="text/css" href="http://www.agideo.com/lib/ext-1.0-alpha3/resources/css/ytheme-aero.css" />  
  7. <script type="text/javascript" src="http://www.agideo.com/lib/ext-1.0-alpha3/yui-utilities.js">script>       
  8. <script type="text/javascript" src="http://www.agideo.com/lib/ext-1.0-alpha3/ext-yui-adapter.js">script>        
  9. <script type="text/javascript" src="http://www.agideo.com/lib/ext-1.0-alpha3/ext-all.js">script>  
  10. <style>  
  11.   .red{   
  12.   background-color : red;   
  13. }   
  14. style>  
  15.   
  16. <script>  
  17. function f1()   
  18.     {         
  19.       var myDiv = Ext.get('myDiv');   
  20.       myDiv.highlight();      // The element's background will highlight to yellow then fade back   
  21.     }     
  22.     function f2()   
  23.     {   
  24.       var myDiv = Ext.get('myDiv');   
  25.       myDiv.addClass('red');  // Add a custom CSS class (defined in ExtStart.css)   
  26.     }   
  27.     
  28.     
  29.     function f3()   
  30.     {   
  31.       var myDiv = Ext.get('myDiv');   
  32.       myDiv.center();         // Center the element in the viewport   
  33.     }   
  34.     function f4()   
  35.     {   
  36.       var myDiv = Ext.get('myDiv');   
  37.       myDiv.setOpacity(.25);  // Make the element partially-transparent   
  38.     }   
  39. script>  
  40. head>  
  41. <body>  
  42.   <div id='myDiv'>  
  43.     Lession 1   
  44.   div>  
  45. <input type="button" value="highlight" name="btn" onclick="f1();" />  
  46. <input type="button" value="addClass" name="btn" onclick="f2();" />  
  47. <input type="button" value="center" name="btn" onclick="f3();" />  
  48. <input type="button" value="setOpacity" name="btn" onclick="f4();" />  
  49. body>  
  50. html>  
评论
发表评论

您还没有登录,请登录后发表评论

open2ye
搜索本博客
我的相册
50090eed-4306-3c9c-a06c-c2627f008575-thumb
mary.JPG
共 27 张
最近加入圈子
存档
最新评论