oxjs/demos/form2/events.html
2010-09-03 10:47:40 +02:00

44 lines
No EOL
2 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="../../build/css/ox.ui.css"/>
<link rel="stylesheet" type="text/css" href="css/form.css"/>
<script type="text/javascript" src="../../build/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../../build/js/ox.js"></script>
<script type="text/javascript" src="../../build/js/ox.data.js"></script>
<script type="text/javascript" src="../../build/js/ox.ui.js"></script>
<script>
$(function() {
var fn = function() {
alert("OK");
},
$button = new Ox.Button({id: "button", title: "Button"})
.appendTo($("body")),
$bind = new Ox.Button({id: "bind", title: "Bind"})
.bindEvent("click", function() {
Ox.print("Click Bind")
Ox.Event.bind($button.options("id"), "click", fn);
})
.appendTo($("body")),
$unbind = new Ox.Button({id: "unbind", title: "Unbind"})
.bindEvent("click", function() {
Ox.print("Click Unbind")
Ox.Event.unbind($button.options("id"), "click", fn);
})
.appendTo($("body")),
$change = new Ox.Button({id: "change", title: "Change ID"})
.bindEvent("click", function() {
Ox.print("Click Change ID")
$button.options({
id: "button2",
title: "Button 2"
});
})
.appendTo($("body"));
});
</script>
</head>
<body></body>
</html>