xml 代码
- <html>
- <head>
- <title>Ext lession 1 - heat class Elementtitle>
- <link rel="stylesheet" type="text/css" href="http://www.agideo.com/lib/ext-1.0-alpha3/resources/css/ext-all.css"/>
- <link rel="stylesheet" type="text/css" href="http://www.agideo.com/lib/ext-1.0-alpha3/resources/css/ytheme-aero.css" />
- <script type="text/javascript" src="http://www.agideo.com/lib/ext-1.0-alpha3/yui-utilities.js">script>
- <script type="text/javascript" src="http://www.agideo.com/lib/ext-1.0-alpha3/ext-yui-adapter.js">script>
- <script type="text/javascript" src="http://www.agideo.com/lib/ext-1.0-alpha3/ext-all.js">script>
- <style>
- .red{
- background-color : red;
- }
- style>
- <script>
- function f1()
- {
- var myDiv = Ext.get('myDiv');
- myDiv.highlight(); // The element's background will highlight to yellow then fade back
- }
- function f2()
- {
- var myDiv = Ext.get('myDiv');
- myDiv.addClass('red'); // Add a custom CSS class (defined in ExtStart.css)
- }
- function f3()
- {
- var myDiv = Ext.get('myDiv');
- myDiv.center(); // Center the element in the viewport
- }
- function f4()
- {
- var myDiv = Ext.get('myDiv');
- myDiv.setOpacity(.25); // Make the element partially-transparent
- }
- script>
- head>
- <body>
- <div id='myDiv'>
- Lession 1
- div>
- <input type="button" value="highlight" name="btn" onclick="f1();" />
- <input type="button" value="addClass" name="btn" onclick="f2();" />
- <input type="button" value="center" name="btn" onclick="f3();" />
- <input type="button" value="setOpacity" name="btn" onclick="f4();" />
- body>
- html>