Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a range input #325

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![esos_dev](https://s3.amazonaws.com/dev.pstrs.xcut.me/4.99.svg)](http://localhost:3000/subscribe/shaharsol/jQuery-Knob)
[![esos_dev](https://s3.amazonaws.com/dev.pstrs.xcut.me/4.99.svg)](http://localhost:3000/subscribe/shaharsol/jQuery-Knob)
[![esos_dev](https://s3.amazonaws.com/dev.pstrs.xcut.me/4.99.svg)](http://localhost:3000/subscribe/shaharsol/jQuery-Knob)
jQuery Knob
=============

Expand Down
5 changes: 5 additions & 0 deletions dist/jquery-1.12.2.min.js

Large diffs are not rendered by default.

File renamed without changes.
59 changes: 59 additions & 0 deletions example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<script src="./js/jquery-1.12.2.js"></script>
<script src="./js/jquery.knob.js"></script>
</head>
<body>
<input type="text" value="0" class="dial">

<span id="initAngle"></span>
<span id="realVal"></span>
<button id="test1">Test reset</button>
<button id="test2">Test value</button>
<button id="test3">Show values</button>
<script>
$(function() {
var dialAngle = 0;
var dialVal = 0;
$(".dial").knob({
'min': 0,
'max': 360,
'firstClickSetStart': true,
'release' : function (v) {
console.log(v);
if(this.o.firstClickSetStart) {
$('#initAngle').text(v);
$('#realVal').text(0);
dialAngle = v;
dialVal = 0;
} else {
$('#initAngle').text((this.o.initialAngle || 0));
$('#realVal').text(v);
dialAngle = this.o.initialAngle || 0;
dialVal = v;
}
},
});
$('#test1').click(function() {
$('.dial').trigger(
'configure',
{
"fgColor":"#FF0000",
"skin":"tron",
"initialAngle": 45,
"firstClickSetStart": false,
}
);
});
$('#test2').click(function() {
$('.dial').val(90).trigger('change');
});
$('#test3').click(function() {
alert(dialAngle);
alert(dialVal);
});
});
</script>
</body>
</html>
Loading