|
楼主 |
发表于 2008-5-9 08:41:37
|
显示全部楼层
先定义的applications,现在定义的接口主要是Mail Safari Stocks SMS Phone Weather Photos Camera Clock YouTube Calendar Calculator
我就写了一个event事件,使用iphone内部model,编写一个网页html
<head>
<title>iphone Drag & Drop</title>
<meta name="viewport" content="width=310; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<style type="text/css" media="screen">
body {
margin: 0;
padding: 0;
width: 320px;
height: 416px;
font-family: Helvetica;
-webkit-user-select: none;
cursor: default;
-webkit-text-size-adjust: none;
background: #000000;
color: #FFFFFF;
}
#dropItem {
position: absolute;
left: 10px;
top: 10px;
width: 300px;
height: 303px;
border-color: #000000;
background-image: url( 'globe.png' );
}
</style>
<script type="application/x-javascript">
addEventListener('load', function() {
setTimeout(function() {
window.scrollTo(0, 1);
}, 100);
}, false);
</script>
</head>
<body>
<form>
<textarea id="dropItem" readonly="readonly" disabled="true"></textarea>
</form>
<script type="application/x-javascript">
var dropItem = document.getElementById('dropItem');
window.onmousewheel = moveItem;
function moveItem(wEvent) {
var delta = wEvent.wheelDelta/120;
var currentTop = parseInt(dropItem.style.top) || 0;
currentTop = currentTop + delta;
dropItem.style.top = (currentTop) + "px";
setTimeout(function() {
if ( currentTop > 195 )
dropItem.style.backgroundImage = 'url( globemelt.png)';
else if ( currentTop < 195 )
dropItem.style.backgroundImage = 'url( globe.png)';
}, 100);
setTimeout(function() {
window.scrollTo(0, 1);
}, 100);
}
</script>
</body>
</html> |
|