锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产亚洲网站,国产成人亚洲午夜电影,偷自拍亚洲视频在线观看99http://m.tkk7.com/Good-Game/category/25594.htmlzh-cnMon, 12 Nov 2007 16:23:24 GMTMon, 12 Nov 2007 16:23:24 GMT60jquery瀛︿範絎旇_2http://m.tkk7.com/Good-Game/archive/2007/11/09/159292.htmlG_GG_GFri, 09 Nov 2007 02:34:00 GMThttp://m.tkk7.com/Good-Game/archive/2007/11/09/159292.htmlhttp://m.tkk7.com/Good-Game/comments/159292.htmlhttp://m.tkk7.com/Good-Game/archive/2007/11/09/159292.html#Feedback0http://m.tkk7.com/Good-Game/comments/commentRss/159292.htmlhttp://m.tkk7.com/Good-Game/services/trackbacks/159292.htmlhttp://visualjquery.com/1.1.2.html
DOM
Attributes

1.attr(key, value)
$("img").attr("title", "xx");
涔熸槸瀵瑰睘鎬х殑娣誨姞浣嗗彲浠ュ姩鎬?br />eg:聽聽聽 鍦ㄦ瘡嬈$粰title鏃?鍔ㄦ佷簡寮濮?br /><img title="pic" /><img title="pic" /><img title="pic" />
閫氳繃$("img").attr("title", function(index) { return this.title + (i + 1); });
<img title="pic1" /><img title="pic2" /><img title="pic3" />

2.聽 html 鍐呭鍙栥佽祴鍊?br />鍙柭犅?lt;div><input/></div>聽 ->>聽聽$("div").html(); ->>聽 緇撴灉錛?lt;input/>
璧嬄?$("div").html("<b>new stuff</b>"); ->><div><b>new stuff</b></div>
閫氳繃榪?ajax 灝卞緢綆鍗曚簡銆俕_^

Manipulation
1.浣嶇疆璋冩崲 after, append銆乥efore
$("p").after("<b>Hello</b>");聽聽聽 <p>鍚?娣誨姞 <b>..
$("p").after( $("#foo")[0] );聽 鎶奿d涓篺oo鐨勬爣絳劇Щ鍔ㄥ埌<p>鍚?br />
$("input[@name='butt1']").clone().prependTo("form"); //clone in form



G_G 2007-11-09 10:34 鍙戣〃璇勮
]]>
jquery 瀛︿範絎旇_1http://m.tkk7.com/Good-Game/archive/2007/11/08/159129.htmlG_GG_GThu, 08 Nov 2007 09:12:00 GMThttp://m.tkk7.com/Good-Game/archive/2007/11/08/159129.htmlhttp://m.tkk7.com/Good-Game/comments/159129.htmlhttp://m.tkk7.com/Good-Game/archive/2007/11/08/159129.html#Feedback0http://m.tkk7.com/Good-Game/comments/commentRss/159129.htmlhttp://m.tkk7.com/Good-Game/services/trackbacks/159129.html聽聽聽 http://visualjquery.com/1.1.2.html

1.瀹氫綅
$(聽'xx'聽)
  $("p[a]").hide();
$("p:eq(0)").show();
$("div:visible").hide();
$("ul/li")
/* valid too: $("ul > li") */
$("p.foo[a]");
$("input[@name=bar]").val();
$("input[@type=radio][@checked]")


2.浜嬩歡娣誨姞
聽聽 <a href="#" name="li" >Link</a>

聽聽 $(document).ready(
function()聽{
聽聽聽聽聽聽聽聽 $(
"a").click(function()聽{聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽 $("div").hide(); //璺屼唬涓嶅彲瑙?<a>

聽聽聽聽聽 });
聽聽聽 });

3.欏甸潰 javascript 杈撳叆錛堝拰jsp鐨?out.print(...)錛?b>$(html)
$("<div聽id='div1'><font聽color='red''>Hello</font></div>").appendTo("body");

4.鍐檆ss
$(document.body).css(聽"background",聽"black"聽);

5.鍖呭惈瀹氫綅
<p>one</p> <div><p>two</p></div> <div>three</div>

$(
"div聽>聽p") //瀹氫綅two <p>two</p>

6.鑼冨洿瀹氫綅
<body>
聽聽聽聽聽聽聽聽
<form>
聽聽聽聽聽聽聽聽聽聽聽聽
<input聽type="button"聽value="鍝堝搱"/>
聽聽聽聽聽聽聽聽
</form>
</body>

$("input:button",聽document.forms[0])[0].setAttribute("value","google");
鎴?/span>聽 $("div", xml.responseXML) 絳?br />

7.琛ㄨ揪璇曞畾浣?div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">$("p[@name='p1']").hide();//hide涓嶈聽$(..)[0]

$("input[@name='butt1']:button",聽document.forms[0])[0].setAttribute("value","google");

8.$(..).fun.. 娣誨姞鏂規硶
聽聽聽聽聽聽聽聽<form>
聽聽聽聽聽聽聽聽聽聽聽聽
<input聽name="butt1"聽type="button"聽value="google"/>
聽聽聽聽聽聽聽聽
</form>
聽聽聽聽聽聽聽聽
<script>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽jQuery.fn.extend({
聽聽聽聽聽聽聽聽聽聽check:聽
function()聽{
聽聽聽聽聽聽聽聽聽聽聽聽alert('check');
聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽});
聽聽聽聽聽聽聽聽$(
"input[@name='butt1']:button",聽document.forms[0]).check();
聽聽聽聽聽聽聽聽
</script>

鎴?br />
jQuery.extend({
min: function(a, b) { return a < b ? a : b; },
max: function(a, b) { return a > b ? a : b; }
});


9.
$.noConflict()
聽聽聽聽<body>
聽聽聽聽聽聽聽聽
<form>
聽聽聽聽聽聽聽聽聽聽聽聽
<input聽name="butt1"聽type="button"聽value="google"/>
聽聽聽聽聽聽聽聽
</form>
聽聽聽聽聽聽聽聽
<a聽href="#"聽temp_href="#"聽name="li">Link</a>
聽聽聽聽聽聽聽聽
<script>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽
var聽$j聽=聽jQuery.noConflict();聽聽
聽聽聽聽聽聽聽
聽聽聽聽聽
//聽Use聽jQuery聽via聽$j()聽聽
聽聽聽聽聽$j(document).ready(function(){聽聽
聽聽聽聽聽聽聽聽$(
"a").click(function()聽{聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽$j(document.forms[
0]).hide();聽聽
聽聽聽聽聽聽聽聽聽聽聽});
聽聽聽聽聽});聽
聽聽聽聽聽聽聽聽
</script>
聽聽聽聽
</body>

10. $ 涓鑸柟娉?br />
//each(fn)
$("img").each(function(i){
聽聽this.src聽=聽"test"聽+聽i聽+聽".jpg";
});
<img/><img/>
<img聽src="test0.jpg"/><img聽src="test1.jpg"/>


$("p").eq(1) //鍚?涓?br />$("p").lt(1) //姝e彇 1 寮濮?br />
$("img").get();//鍏ㄥ彇
$("img").get(0); //欏哄簭鍙?0寮濮?br />$("p").gt(0) //鍙嶅彇浠?寮濮?br />
$("*").index( $('#foo')[0] )
<div id="foobar"><b></b><span id="foo"></span></div>
榪斿洖緇撴灉 2

$("img").length; //鎬婚暱搴?br />$("img").size();









G_G 2007-11-08 17:12 鍙戣〃璇勮
]]>
dojo 0.9絎旇_layouthttp://m.tkk7.com/Good-Game/archive/2007/09/07/143350.htmlG_GG_GFri, 07 Sep 2007 03:19:00 GMThttp://m.tkk7.com/Good-Game/archive/2007/09/07/143350.htmlhttp://m.tkk7.com/Good-Game/comments/143350.htmlhttp://m.tkk7.com/Good-Game/archive/2007/09/07/143350.html#Feedback0http://m.tkk7.com/Good-Game/comments/commentRss/143350.htmlhttp://m.tkk7.com/Good-Game/services/trackbacks/143350.html
聽聽聽聽聽聽聽聽<script聽type="text/javascript">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dojo.require(
"dijit.layout.LayoutContainer");聽聽//浣嶇疆鍜屽畼鏂圭殑鍙嶈繃鏉?IE 灝辨病浜嬩簡 @#$%^!
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dojo.require(
"dijit.layout.ContentPane");聽聽 // FF娌¤繖闂聽 .榪樻槸FF濂藉晩 澶у鏀寔FF聽聽 ^_^
聽聽聽聽聽
</script>

<html>
<head>
<title>Layout聽Container聽Demo聽1</title>
聽聽聽聽
<style聽type="text/css">
聽聽聽聽聽聽聽聽@import聽"/dojoCharset/js/dojo/dijit/themes/tundra/tundra.css";
聽聽聽聽聽聽聽聽@import聽"/dojoCharset/js/dojo/dojo/dojo.css"
聽聽聽聽
</style>
聽聽聽聽聽聽聽聽
<script聽type="text/javascript"聽src="/dojoCharset/js/dojo/dojo/dojo.js"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽djConfig
="parseOnLoad:聽true"></script>
聽聽聽聽聽聽聽聽
<script聽type="text/javascript"聽src="/dojoCharset/js/create/cr.js"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽djConfig
="parseOnLoad:聽true"></script>聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽
<script聽type="text/javascript">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dojo.require(
"dijit.layout.LayoutContainer");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dojo.require(
"dijit.layout.ContentPane");
聽聽聽聽聽
</script>
</head>
<body聽class="tundra">

<div聽dojoType="dijit.layout.LayoutContainer"聽style="width:聽100%;聽height:聽100%">聽聽聽 //寮涓涓?LayOut 絀洪棿
聽聽聽
<div聽dojoType="dijit.layout.ContentPane"聽layoutAlign="top"聽style="background-color:red"聽href="/dojoCharset/html/top.jsp"> //top
聽聽聽聽聽聽聽聽The聽Dojo聽Book
聽聽聽
</div>
聽聽聽
<div聽聽dojoType="dijit.layout.ContentPane"聽layoutAlign="left"聽 //left
聽聽聽聽聽聽聽聽style
="background-color:lightblue;width:聽120px;">
聽聽聽聽聽聽聽聽Table聽of聽Contents
聽聽聽聽
</div>
聽聽聽聽
<div聽id='div'聽dojoType="dijit.layout.ContentPane"聽layoutAlign="client"聽聽聽聽聽聽聽聽 //client
聽聽聽聽聽聽聽聽style
="background-color:yellow">
聽聽聽聽聽聽聽聽聽聽聽聽
<blockquote><a聽href="../node/717">Introduction</a>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<ol>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<li><a聽href="../node/718">Dojo:聽What聽is聽It?</a></li>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<li><a聽href="../node/719">History</a></li>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<li><a聽href="../node/733">What聽Dojo聽Gives聽You</a></li>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
</ol>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
</blockquote>
聽聽聽聽
</div>
</div>聽聽聽聽聽聽聽
</body></html>

cr.js
聽聽聽聽function聽on(){
聽聽聽聽聽聽聽
function聽helloPressed(){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽window.alert('ok');
聽聽聽聽聽聽聽聽聽聽聽聽dojo.xhrGet(
{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽url:聽'
/dojoCharset/html/top.jsp',聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽handleAs:聽
"text",
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽encoding:聽
"utf-8",
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽timeout:聽
5000,聽//聽Time聽in聽milliseconds
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽load:聽function(data,聽ioArgs)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽document.getElementById('div').innerHTML聽
=聽data聽;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽聽聽聽聽}
);
聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽聽聽聽聽聽聽dojo.addOnLoad(helloPressed);聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽
聽聽聽聽}

top.js
<!DOCTYPE聽HTML聽PUBLIC聽"-//W3C//DTD聽HTML聽4.01//ZH-CN"聽"http://www.w3.org/TR/html4/strict.dtd">
<%@聽page聽contentType="text/html;charset=gb2312"%>
<html>
聽聽聽聽
<head>
聽聽聽聽聽聽聽聽
<meta聽http-equiv="Content-Type"聽content="text/html;聽charset=GB2312">聽聽
聽聽聽聽聽聽聽聽
<script聽type="text/javascript"
聽聽聽聽聽聽聽聽聽聽聽聽src
="/dojoCharset/js/create/cr.js"></script>
聽聽聽聽
</head>
聽聽聽聽
<body>
聽聽聽聽聽聽聽聽
<center>
聽聽聽聽聽聽聽聽聽聽聽聽
<h3>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<font聽color='darkcyan'>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽澶у濂?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
</font>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
<INPUT聽id='butt'聽value="list"聽type="button"聽onclick="on()"/>
聽聽聽聽聽聽聽聽聽聽聽聽
</h3>
聽聽聽聽聽聽聽聽
</center>
聽聽聽聽
</body>
聽聽聽聽
</html>


G_G 2007-09-07 11:19 鍙戣〃璇勮
]]>
dojo 灝忕粨http://m.tkk7.com/Good-Game/archive/2007/09/06/143235.htmlG_GG_GThu, 06 Sep 2007 09:52:00 GMThttp://m.tkk7.com/Good-Game/archive/2007/09/06/143235.htmlhttp://m.tkk7.com/Good-Game/comments/143235.htmlhttp://m.tkk7.com/Good-Game/archive/2007/09/06/143235.html#Feedback0http://m.tkk7.com/Good-Game/comments/commentRss/143235.htmlhttp://m.tkk7.com/Good-Game/services/trackbacks/143235.html欏甸潰 鐨?LayOut 鐢? LayoutContainer
聽聽聽榪欓噷鏈変釜闂 html -> html聽聽鐨勪貢鐮侀棶棰樹笉鏄緢濂借В鍐?鍙兘鏄痙ojo 0.9 bug??) 榪?top , left .... 絳夊彲浠ョ敤 .jsp鏉ュ仛 鍐嶇敤dojoLayout鍔犲叆涓婚〉闈?.html

<! DOCTYPE聽HTML聽PUBLIC聽"-//W3C//DTD聽HTML聽4.01//EN"
聽聽聽聽聽聽聽聽聽聽聽聽"http://www.w3.org/TR/html4/strict.dtd"
>
< html >
< head >
< title > Layout聽Container聽Demo聽1 </ title >
聽聽聽聽
< style聽 type ="text/css" >
聽聽聽聽聽聽聽聽@import聽"http://127.0.0.1:7000/dojoCharset/js/dojo/dijit/themes/tundra/tundra.css";
聽聽聽聽聽聽聽聽@import聽"http://127.0.0.1:7000/dojoCharset/js/dojo/dojo/dojo.css"
聽聽聽聽
</ style >
聽聽聽聽聽聽聽聽
< script聽 type ="text/javascript" 聽src ="http://127.0.0.1:7000/dojoCharset/js/dojo/dojo/dojo.js"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽djConfig
="parseOnLoad:聽true" ></ script >
聽聽聽聽聽聽聽聽
< script聽 type ="text/javascript" >
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dojo.require(
" dijit.layout.ContentPane " );
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dojo.require(
" dijit.layout.LayoutContainer " );
聽聽聽聽聽
</ script >
</ head >
< body聽 class ="tundra" >

< div聽 dojoType ="dijit.layout.LayoutContainer" 聽style ="width:聽100%;聽height:聽100%" >
聽聽 //榪欓噷 href 鏄叧閿埌鍏?top.jsp 榪樻病涔辯爜闂聽
聽聽聽
< div聽 dojoType ="dijit.layout.ContentPane" 聽layoutAlign ="top" 聽style ="background-color:red" href ="http://127.0.0.1:7000/dojoCharset/html/top.jsp" >
聽聽聽
</ div >
聽聽聽
< div聽 dojoType ="dijit.layout.ContentPane" 聽layoutAlign ="left"
聽聽聽聽聽聽聽聽style
="background-color:lightblue;width:聽120px;" >
聽聽聽聽
</ div >
聽聽聽聽
< div聽 dojoType ="dijit.layout.ContentPane" 聽layoutAlign ="client"
聽聽聽聽聽聽聽聽style
="background-color:yellow" >
聽聽聽聽 </ div >
</ div > 聽聽聽聽聽聽聽
</ body ></ html >

鎴栬呯敤 涓縐嶆瘮杈冨鏉備絾鐏墊椿鐨勬柟娉?br />
<html>
聽聽
<head>聽聽
聽聽聽聽
<title>Dojo:聽Hello聽World!</title>
聽聽聽聽
<meta聽http-equiv="Content-Type"聽content="text/html;聽charset=utf-8"/>聽聽聽聽

聽聽聽聽
<!--聽SECTION聽1聽-->
聽聽
<script聽type="text/javascript"
聽聽聽聽src
="http://127.0.0.1:7000/dojoCharset/js/dojo/dojo/dojo.js"></script>
聽聽聽聽
<!--聽SECTION聽2聽-->
聽聽聽聽
<script聽type="text/javascript">
聽聽聽聽聽聽
function聽helloPressed()
聽聽聽聽聽聽{
聽聽聽聽聽聽聽聽dojo.xhrGet({
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽url:聽'http:
//127.0.0.1:7000/dojoCharset/dojo',聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽handleAs:聽"text",
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽encoding:聽
"utf-8",
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽timeout:聽
5000,聽//聽Time聽in聽milliseconds
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽load:聽function(data,聽ioArgs)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽window.alert(data);聽聽
//聽Prints聽"peach"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽document.getElementById('div').innerHTML聽=聽data聽;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽// div 娣誨姞
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽});
聽聽聽聽聽聽}
聽聽聽聽dojo.addOnLoad(helloPressed);
聽聽聽聽
</script>
聽聽聽聽
<div聽id='div'聽/>
</html>


G_G 2007-09-06 17:52 鍙戣〃璇勮
]]>
dojo 0.9 瀛︿範(3) _collectionshttp://m.tkk7.com/Good-Game/archive/2007/09/05/142919.htmlG_GG_GWed, 05 Sep 2007 08:06:00 GMThttp://m.tkk7.com/Good-Game/archive/2007/09/05/142919.htmlhttp://m.tkk7.com/Good-Game/comments/142919.htmlhttp://m.tkk7.com/Good-Game/archive/2007/09/05/142919.html#Feedback0http://m.tkk7.com/Good-Game/comments/commentRss/142919.htmlhttp://m.tkk7.com/Good-Game/services/trackbacks/142919.html
聽聽聽聽
<script聽type="text/javascript">

dojo.require(
"dojox.collections.ArrayList");

dojo.addOnLoad(
function(){
聽聽聽聽
var聽a聽=聽['a1','a2'];
聽聽聽聽
var聽arr聽=new聽dojox.collections.ArrayList(a);聽
聽聽聽聽arr.add('xx1');
聽聽聽聽arr.add('xx2');
聽聽聽聽arr.add('xx3');
聽聽聽聽
聽聽聽聽//榪甫
聽聽聽聽
var聽it聽=聽arr.getIterator();
聽聽聽聽
while(!it.atEnd()){
聽聽聽聽聽聽聽聽document.writeln(聽it.get());
聽聽聽聽}
聽聽聽聽
聽聽聽//鏁伴噺
聽聽聽聽document.writeln(arr.count);
聽聽聽聽
聽聽聽聽//鍒犻櫎
聽聽聽聽arr.remove('xx1');
聽聽聽聽
聽聽聽聽
var聽arr_str聽=聽arr.toString()
聽聽聽聽document.writeln(聽arr_str聽);
});

</script>

涓巎ava鐨刢ollections 寰堢浉鍚屾柟娉曞氨涓嶄竴涓浠嬬粛浜?br />addRange --add 闆嗗悎
clear , clone , contains , indexOf , insert ,
item聽 -- get(i),
removeAt(i),
reverse ???,
sort,
toArray .聽return 聽object[]

G_G 2007-09-05 16:06 鍙戣〃璇勮
]]>
dojo 0.9 絎旇(2) _鐢誨浘http://m.tkk7.com/Good-Game/archive/2007/09/05/142906.htmlG_GG_GWed, 05 Sep 2007 07:21:00 GMThttp://m.tkk7.com/Good-Game/archive/2007/09/05/142906.htmlhttp://m.tkk7.com/Good-Game/comments/142906.htmlhttp://m.tkk7.com/Good-Game/archive/2007/09/05/142906.html#Feedback0http://m.tkk7.com/Good-Game/comments/commentRss/142906.htmlhttp://m.tkk7.com/Good-Game/services/trackbacks/142906.html 1.鐢誨浘
<! DOCTYPE聽HTML聽PUBLIC聽"-//W3C//DTD聽HTML聽4.01//ZH-CN"聽"http://www.w3.org/TR/html4/strict.dtd" >
< html >
聽聽聽聽
< head >
聽聽聽聽聽聽聽聽
< meta聽 http-equiv ="Content-Type" 聽content ="text/html" />
聽聽聽聽聽聽聽聽
< script聽 type ="text/javascript" 聽src ="http://127.0.0.1:8000/lib/dojo/dojo_0.9/dojo/dojo.js"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽djConfig
="parseOnLoad:聽true" ></ script >
聽聽聽聽
< style聽 type ="text/css" >
聽聽聽聽聽聽聽聽@import聽"http://127.0.0.1:8000/lib/dojo/dojo_0.9/dojo/resources/dojo.css";
聽聽聽聽聽聽聽聽@import聽"http://127.0.0.1:8000/lib/dojo/dojo_0.9/dijit/tests/css/dijitTests.css";
聽聽聽聽
</ style > 聽聽聽聽
< script聽 type ="text/javascript" >
dojo.require(
" dojox.gfx " );
dojo.addOnLoad(
function (){
聽聽聽聽container聽
= 聽dojo.byId( " gfx_holder " );
聽聽聽聽
var 聽surface聽 = 聽dojox.gfx.createSurface(container,聽 385 ,聽 385 );聽聽聽聽聽聽聽聽 // 鍒涘緩鍥捐寖鍥?/span>
聽聽聽聽surface.createImage({width:聽 30 ,聽height:聽 40 ,聽src:聽 " http://127.0.0.1:8000/images/tomcat.ico " });聽聽 // create聽

聽聽聽聽surface.createCircle({cx:聽 100 ,聽cy:聽 100 ,聽r:聽 20 })聽.setFill('blue');
聽聽聽聽
聽聽聽聽surface.createLine({x1:聽
0 ,聽y1:聽 350 ,聽x2:聽 700 ,聽y2:聽 250 }).setStroke( " green " );
聽聽聽聽
聽聽聽聽surface.createRect({x:聽
70 ,聽y:聽 70 ,聽width:聽 20 ,聽height:聽 20 }).setFill( " red " );
聽聽聽聽
聽聽聽聽
var 聽hour_hand_points聽 = 聽[{x:聽 50 ,聽y:聽 82 },聽{x:聽 100 ,聽y:聽 15 },{x:聽 200 ,聽y:聽 20 }];
聽聽聽聽surface.createPolyline(hour_hand_points).setFill('aqua');
聽聽聽聽
聽聽聽聽
聽聽聽聽
var 聽m聽 = 聽dojox.gfx.matrix;
聽聽聽聽
var 聽initial_matrix聽 = 聽m.translate( 250 ,聽 250 );
聽聽聽聽g聽
= 聽surface.createGroup().setTransform(initial_matrix);
聽聽聽聽
var 聽f,聽s聽 = 聽{color:聽 " black " ,聽width:聽 1 };
聽聽聽聽f聽
= " #ffffff " ;聽s聽 = 聽{color:聽 " #000000 " ,聽width:聽 0.172 };
聽聽聽聽g.createPath(
" M-122.304聽84.285C-122.304聽2000.285聽-122.203聽86.179聽-123.027聽86.16C-123.851聽700.141聽-140.305聽38.066聽-160.833聽40.309C-160.833聽40.309聽-143.05聽32.956聽-122.304聽84.285z " ).setFill(f).setStroke(s);
聽聽聽聽//鐢葷敾 涓嶈繃澶╃煡閬撶敾鐨勬槸浠涔?/font>
聽聽聽聽
});
</ script >
< div聽 id ="gfx_holder" 聽style ="width:聽385px;聽height:聽385px;" ></ div >

</ html >
聽聽case dojox.gfx.defaultPath.type:聽聽return this.createPath(shape);
聽聽case dojox.gfx.defaultRect.type:聽聽return this.createRect(shape);
聽聽case dojox.gfx.defaultCircle.type:聽聽return this.createCircle(shape);
聽聽case dojox.gfx.defaultEllipse.type:聽聽return this.createEllipse(shape);
聽聽case dojox.gfx.defaultLine.type:聽聽return this.createLine(shape);
聽聽case dojox.gfx.defaultPolyline.type:聽return this.createPolyline(shape);
聽聽case dojox.gfx.defaultImage.type:聽聽return this.createImage(shape);
聽聽case dojox.gfx.defaultText.type:聽聽return this.createText(shape);
聽聽case dojox.gfx.defaultTextPath.type:聽return this.createTextPath(shape);
鍙互create鐨?鏂規硶


2.鍥捐薄鎷栧姩浜嬩歡
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽-----姝f柟褰?-------
<!DOCTYPE聽HTML聽PUBLIC聽"-//W3C//DTD聽HTML聽4.01//ZH-CN"聽"http://www.w3.org/TR/html4/strict.dtd">
<html>
聽聽聽聽
<head>
聽聽聽聽聽聽聽聽
<meta聽http-equiv="Content-Type"聽content="text/html"/>
聽聽聽聽聽聽聽聽
<script聽type="text/javascript"聽src="http://127.0.0.1:8000/lib/dojo/dojo_0.9/dojo/dojo.js"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽djConfig
="parseOnLoad:聽true"></script>
聽聽聽聽
<style聽type="text/css">
聽聽聽聽聽聽聽聽@import聽"http://127.0.0.1:8000/lib/dojo/dojo_0.9/dojo/resources/dojo.css";
聽聽聽聽聽聽聽聽@import聽"http://127.0.0.1:8000/lib/dojo/dojo_0.9/dijit/tests/css/dijitTests.css";
聽聽聽聽
</style>聽聽聽聽
<script聽type="text/javascript">

dojo.require(
"dojox.gfx");

var聽container聽=null;
var聽container_position聽=null;
var聽surface聽=null;
var聽surface_size聽=null;


var聽gShapes聽=聽{}
var聽gShapeCounter聽=0;

function聽makeCircleGrid(aShape)
{
聽聽聽聽聽聽聽聽
var聽id聽="shape_"+聽(gShapeCounter++);
聽聽聽聽聽聽聽聽aShape.getEventSource().setAttribute('shapeid',聽id);
聽聽聽聽聽聽聽聽dojox.gfx._addClass(aShape.getEventSource(),聽
"movable");
聽聽聽聽聽聽聽聽gShapes[id]聽
=聽aShape;
聽聽聽聽
}

var聽current_shape聽=null;
var聽current_shape_window聽=null;
var聽last_position聽=null;

function聽getShape(event)
{
聽聽聽聽
var聽id聽=聽event.target.getAttribute('shapeid');
聽聽聽聽
var聽s聽聽=聽id聽?聽gShapes[id]聽:聽null;
聽聽聽聽
return聽s;
}

function聽handleMouseDown(event)
{
聽聽聽聽
var聽shape聽=聽getShape(event);
聽聽聽聽
if聽(shape)聽{
聽聽聽聽聽聽聽聽current_shape聽
=聽shape;
聽聽聽聽聽聽聽聽last_position聽
=聽{
聽聽聽聽聽聽聽聽聽聽聽聽x:聽event.clientX聽
-聽container_position.x,
聽聽聽聽聽聽聽聽聽聽聽聽y:聽event.clientY聽
-聽container_position.y
聽聽聽聽聽聽聽聽};
聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽
var聽params聽=聽shape.getShape();
聽聽聽聽聽聽聽聽聽//姝f柟褰㈢殑鏄?params [x ,y width,height]
聽聽聽聽聽聽聽聽
var聽center聽=聽dojox.gfx.matrix.multiplyPoint(shape.getTransform(),聽params.x,聽params.y);
聽聽聽聽聽聽聽聽
var聽dx聽=聽last_position.x聽-聽center.x;
聽聽聽聽聽聽聽聽
var聽dy聽=聽last_position.y聽-聽center.y;

聽聽聽聽聽聽聽聽current_shape_window聽
=聽{
聽聽聽聽聽聽聽聽聽聽聽聽x1:聽params.width聽
+聽dx,
聽聽聽聽聽聽聽聽聽聽聽聽y1:聽params.height聽
+聽dy,
聽聽聽聽聽聽聽聽聽聽聽聽x2:聽surface_size.width聽聽聽聽
+聽dx,
聽聽聽聽聽聽聽聽聽聽聽聽y2:聽surface_size.height聽聽
+聽dy
聽聽聽聽聽聽聽聽};
聽聽聽聽}
聽聽聽聽dojo.stopEvent(event);
}

function聽handleMouseMove(event)
{
聽聽聽聽
if(!current_shape)聽return;
聽聽聽聽
var聽x聽=聽Math.min(Math.max(event.clientX聽-聽container_position.x,聽current_shape_window.x1),聽current_shape_window.x2);
聽聽聽聽
var聽y聽=聽Math.min(Math.max(event.clientY聽-聽container_position.y,聽current_shape_window.y1),聽current_shape_window.y2);
聽聽聽聽current_shape.applyTransform({dx:聽x聽
-聽last_position.x,聽dy:聽y聽-聽last_position.y});
聽聽聽聽last_position聽
=聽{x:聽x,聽y:聽y};
聽聽聽聽dojo.stopEvent(event);
}

function聽handleMouseUp(event)
{
聽聽聽聽current_shape聽
=null;
聽聽聽聽dojo.stopEvent(event);
}

function聽initGfx()聽{
聽聽聽聽container聽
=聽dojo.byId("gfx_holder");
聽聽聽聽container_position聽
=聽dojo.coords(container,聽true);
聽聽聽聽surface聽
=聽dojox.gfx.createSurface(container,聽500,聽500);
聽聽聽聽surface_size聽
=聽surface.getDimensions();
聽聽聽聽surface_size.width聽聽
=聽parseInt(surface_size.width);
聽聽聽聽surface_size.height聽
=聽parseInt(surface_size.height);


聽聽聽聽
var聽aShape聽=聽surface.createRect({x:聽70,聽y:聽70,聽width:聽20,聽height:聽20}).setFill("red");

聽聽聽聽makeCircleGrid(aShape);

聽聽聽聽dojo.connect(container,聽'onmousedown',聽handleMouseDown);
聽聽聽聽dojo.connect(container,聽'onmousemove',聽handleMouseMove);
聽聽聽聽dojo.connect(container,聽'onmouseup',聽聽聽handleMouseUp);
聽聽聽聽
聽聽聽聽
//聽cancel聽text聽selection聽and聽text聽dragging
聽聽聽聽dojo.connect(container,聽"ondragstart",聽聽聽dojo,聽"stopEvent");
聽聽聽聽dojo.connect(container,聽
"onselectstart",聽dojo,聽"stopEvent");
}

dojo.addOnLoad(initGfx);

</script>

<style聽type="text/css">
.movable聽
{聽cursor:聽pointer;}
</style>

</head>
<body>
聽聽聽聽
<h1>dojox.gfx:聽100聽draggable聽circles</h1>
聽聽聽聽
<div聽id="gfx_holder"聽style="width:聽500px;聽height:聽500px;"></div>
</body>
</html>

聽聽聽聽聽聽聽聽聽 --------鍦嗘槸-----------

function聽handleMouseDown(event)
{
聽聽聽聽
var聽shape聽=聽getShape(event);
聽聽聽聽
if聽(shape)聽{
聽聽聽聽聽聽聽聽current_shape聽
=聽shape;
聽聽聽聽聽聽聽聽last_position聽
=聽{
聽聽聽聽聽聽聽聽聽聽聽聽x:聽event.clientX聽
-聽container_position.x,
聽聽聽聽聽聽聽聽聽聽聽聽y:聽event.clientY聽
-聽container_position.y
聽聽聽聽聽聽聽聽};
聽聽聽聽聽聽聽聽
var聽params聽=聽shape.getShape();
聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽// 褰㈢姸鐨勪笉鍚?灝辨槸 params 鐨勫彇鍊間笉鍚屄爌arams [cx,xy,r]
聽聽聽聽聽聽聽聽
var聽center聽=聽dojox.gfx.matrix.multiplyPoint(shape.getTransform(),聽params.cx,聽params.cy);
聽聽聽聽聽聽聽聽
var聽dx聽=聽last_position.x聽-聽center.x;
聽聽聽聽聽聽聽聽
var聽dy聽=聽last_position.y聽-聽center.y;
聽聽聽聽聽聽聽聽
var聽r聽聽=聽params.r;
聽聽聽聽聽聽聽聽current_shape_window聽
=聽{
聽聽聽聽聽聽聽聽聽聽聽聽x1:聽r聽
+聽dx,
聽聽聽聽聽聽聽聽聽聽聽聽y1:聽r聽
+聽dy,
聽聽聽聽聽聽聽聽聽聽聽聽x2:聽surface_size.width聽聽
-聽r聽+聽dx,
聽聽聽聽聽聽聽聽聽聽聽聽y2:聽surface_size.height聽
-聽r聽+聽dy
聽聽聽聽聽聽聽聽};
聽聽聽聽}
聽聽聽聽dojo.stopEvent(event);
}

鍏朵粬涓嶇敤鍐嶈浜嗗惂!!



G_G 2007-09-05 15:21 鍙戣〃璇勮
]]>
dojo0.9瀛︿範錛?錛?-dojo.declarehttp://m.tkk7.com/Good-Game/archive/2007/09/05/142825.htmlG_GG_GWed, 05 Sep 2007 02:27:00 GMThttp://m.tkk7.com/Good-Game/archive/2007/09/05/142825.htmlhttp://m.tkk7.com/Good-Game/comments/142825.htmlhttp://m.tkk7.com/Good-Game/archive/2007/09/05/142825.html#Feedback0http://m.tkk7.com/Good-Game/comments/commentRss/142825.htmlhttp://m.tkk7.com/Good-Game/services/trackbacks/142825.html鏈夌敤鐨勫湴鏂瑰氨涓嶇敤澶氳浜?....
寮濮嬪涔犲惂 錛?/b>

鍩虹錛?/font>
1. dojo.declare聽 javascript綾繪柟渚夸嬌鐢紙緇ф壙錛屽垱閫犵瓑絳夛級
聽聽聽 <1>綆鍗曞垱閫狅紝浣跨敤
<!DOCTYPE聽HTML聽PUBLIC聽"-//W3C//DTD聽HTML聽4.01//ZH-CN"聽"http://www.w3.org/TR/html4/strict.dtd">
<html>
聽聽聽聽
<head>
聽聽聽聽聽聽聽聽
<meta聽http-equiv="Content-Type"聽content="text/html"/>
聽聽聽聽聽聽聽聽
<script聽type="text/javascript"聽src="http://127.0.0.1:8000/lib/dojo/dojo_0.9/dojo/dojo.js"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽djConfig
="parseOnLoad:聽true"></script>
聽聽聽聽
</head>
聽聽聽聽
<body>
聽聽聽聽
</body>
</html>
<script聽type="text/javascript">
聽聽聽聽dojo.declare(
"DojoClass",null,{
聽聽聽聽聽聽聽聽prptId:聽'foo',
聽聽聽聽聽聽聽聽method:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽window.alert(val);
聽聽聽聽聽聽聽聽}
聽聽聽聽});
聽聽聽聽
聽聽聽聽
var聽obj聽=new聽DojoClass();
聽聽聽聽obj.method('XX');聽聽聽聽聽聽聽聽聽聽聽聽聽 //鏁堟灉 alert('XX')
</script>
聽聽聽 <2>綆鍗曠戶鎵?br />
<script聽type="text/javascript">
聽聽聽聽dojo.declare(
"DojoClass",null,{
聽聽聽聽聽聽聽聽prptId:聽'foo',
聽聽聽聽聽聽聽聽method:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽window.alert(val);
聽聽聽聽聽聽聽聽}
聽聽聽聽});
聽聽聽聽
聽聽聽聽dojo.declare(
"Class",DojoClass,{
聽聽聽聽聽聽聽聽prptId2:'
2222',
聽聽聽聽聽聽聽聽method2:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽window.alert(
"!!!"+val);
聽聽聽聽聽聽聽聽}
聽聽聽聽});
聽聽聽聽
var聽obj聽=new聽Class();
聽聽聽聽obj.method('XX');聽聽 聽聽 聽聽 //鏁堟灉 alert('XX');
聽聽聽聽obj.method2(聽obj.prptId
+obj.prptId2聽); //鏁堟灉 alert( '!!!foo2222' );
聽聽聽聽
</script>
聽聽聽 <3>緇ф壙閲嶅啓
<script聽type="text/javascript">
聽聽聽聽dojo.declare(
"DojoClass",null,{
聽聽聽聽聽聽聽聽prptId:聽'foo',
聽聽聽聽聽聽聽聽method:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽window.alert(val);
聽聽聽聽聽聽聽聽}
聽聽聽聽});
聽聽聽聽
聽聽聽聽dojo.declare(
"Class",DojoClass,{
聽聽聽聽聽聽聽聽prptId2:'
2222',
聽聽聽聽聽聽聽聽method:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽val聽
=聽val+'list';
聽聽聽聽聽聽聽聽聽聽聽聽
this.inherited('method',arguments);
聽聽聽聽聽聽聽聽},
聽聽聽聽聽聽聽聽method2:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽window.alert(
"!!!"+val);
聽聽聽聽聽聽聽聽}
聽聽聽聽});
聽聽聽聽
var聽obj聽=new聽Class();
聽聽聽聽obj.method('XX');聽 //鏁堟灉 alert( 'XXlist' );
聽聽聽聽
聽聽聽聽
</script>
<4> initializer 綾繪瀯閫?br />聽聽聽娌℃垚鍔?錛燂紵 鍘熷洜涓嶆槑
<script聽type="text/javascript">
聽聽聽聽dojo.declare(
"DojoClass",null,{

聽聽聽聽聽聽聽聽initializer:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽
this.prptId=val;
聽聽聽聽聽聽聽聽},
聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽prptId:聽'foo',
聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽method:
function(val){
聽聽聽聽聽聽聽聽聽聽聽聽window.alert(val);
聽聽聽聽聽聽聽聽}
聽聽聽聽});
聽聽聽聽
聽聽聽聽
var聽obj聽=new聽DojoClass('liukaiyi');
聽聽聽聽obj.method(聽obj.prptId聽);聽 //鏁堟灉 alert('foo'); 娌℃垚鍔?/font>
</script>





G_G 2007-09-05 10:27 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 一二三四在线播放免费观看中文版视频 | 亚洲精品天堂在线观看| 成人性生交视频免费观看| 无人视频免费观看免费视频| 亚洲男人的天堂www| 波多野结衣在线免费观看| 亚洲AV无码资源在线观看| 国产亚洲av片在线观看16女人 | 免费一级成人毛片| 一级毛片成人免费看免费不卡| 亚洲熟妇成人精品一区| 亚洲色爱图小说专区| 好先生在线观看免费播放| 2022免费国产精品福利在线| 亚洲午夜精品一区二区公牛电影院| 亚洲精品无码av天堂| 国产成人福利免费视频| 一级毛片a女人刺激视频免费| 亚洲午夜电影在线观看高清| 国产精品亚洲αv天堂无码| 成人片黄网站A毛片免费| 少妇性饥渴无码A区免费| 亚洲AV无码成人精品区狼人影院 | 亚洲中文字幕在线无码一区二区| MM131亚洲国产美女久久 | 日韩精品一区二区亚洲AV观看| 国产gav成人免费播放视频| 在线永久看片免费的视频| 精品一区二区三区高清免费观看| 亚洲Av高清一区二区三区| 亚洲αv在线精品糸列| 亚洲国产成人五月综合网 | 中文字幕看片在线a免费| 亚洲av成人中文无码专区| 亚洲卡一卡2卡三卡4麻豆| 亚洲AV无码成人精品区蜜桃| 亚洲国产精品尤物yw在线 | 亚洲激情视频图片| 久久亚洲AV成人无码国产| 亚洲色欲久久久综合网| 亚洲不卡无码av中文字幕|