You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.5 KiB
47 lines
1.5 KiB
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
|
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/> |
|
<meta name="apple-mobile-web-app-capable" content="yes"/> |
|
<title>Rating</title> |
|
|
|
<script type="text/javascript" src="../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base'],mblUserAgent:'iPhone'"></script> |
|
<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script> |
|
|
|
<script type="text/javascript"> |
|
var val = 0; |
|
require([ |
|
"dijit/registry", |
|
"dojox/mobile/parser", |
|
"dojox/mobile", |
|
"dojox/mobile/compat", |
|
"dojox/mobile/Rating" |
|
], function(registry){ |
|
increment = function(){ |
|
if(val == 7){ return; } |
|
val += 0.5; |
|
registry.byId("star").set("value", val); |
|
document.getElementById("value").innerHTML = val; |
|
}; |
|
decrement = function(){ |
|
if(val == 0){ return; } |
|
val -= 0.5; |
|
registry.byId("star").set("value", val); |
|
document.getElementById("value").innerHTML = val; |
|
}; |
|
}); |
|
</script> |
|
<style> |
|
button { |
|
width: 100px; |
|
} |
|
</style> |
|
</head> |
|
<body style="visibility:hidden;"> |
|
<span id="star" data-dojo-type="dojox.mobile.Rating" data-dojo-props='image:"images/star-orange.png",numStars:7'></span> |
|
<span id="value">0</span><br> |
|
<button type="button" onclick="decrement()">−</button> |
|
<button type="button" onclick="increment()">+</button> |
|
</body> |
|
</html>
|
|
|