Getting Rich with PHP 5 |
![](images/vline.gif) |
2024-09-08 |
![](images/blank.gif) |
![](images/back.gif) |
![](images/blank.gif)
22 |
![](images/next.gif) |
![](images/blank.gif) |
Connection
YAHOO.util.Connect.setForm(formName);
YAHOO.util.Connect.asyncRequest('GET',target,callback);
Dom
var pos = YAHOO.util.Dom.getXY('test');
YAHOO.util.Dom.setXY('target', pos);
YAHOO.util.Dom.setStyle('test', 'opacity', 0.5);
YAHOO.util.Dom.getClientWidth(),
YAHOO.util.Dom.getClientHeight()
// Test if cursor is within 'test' region
var targetRegion = YAHOO.util.Dom.getRegion('test');
var cursorPoint = new YAHOO.util.Point(YAHOO.util.Event.getPageX(e),
YAHOO.util.Event.getPageY(e));
var inRegion = targetRegion.contains(cursorPoint);
Event
function fnCallback(e) { alert("click"); }
YAHOO.util.Event.addListener("elementid", "click", fnCallback);
Animation
var myAnim = new YAHOO.util.Anim('test', { height: {to: 10} });
myAnim.animate();
var myAnim = new YAHOO.util.Motion('test', {points: { to:[10, 10] } });
myAnim.animate();
Drag and Drop
var dd1 = new YAHOO.util.DD("elementid1");
var dd2 = new YAHOO.util.DDTarget("elementid2");
Calendar
<script src = "/yui/YAHOO.js"></script>
<script src = "/yui/dom.js"></script>
<script src = "/yui/event.js"></script>
<script src = "/yui/dragdrop.js"></script>
<script src = "/yui/calendar.js"></script>
<link rel="stylesheet" href="calendar.css" type="text/css">
<div style="height:8em;">
<div id="calContainer" style="height:7em; float:left;"></div>
<a href="javascript:alert(cal.getSelectedDates())">Check</a>
</div>
<script>
dd1 = new YAHOO.util.DD("calContainer");
cal = new YAHOO.widget.Calendar("cal","calContainer");
cal.Options.MULTI_SELECT = true;
cal.render();
</script>
Output
Sliders