Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var divs = $('#divs > div'),
- output = $('#output'),
- tarr = [0, 0, 0, 0],
- delay = 100;
- divs.click(function() {
- $(this).addClass('selected').siblings().removeClass('selected');
- console.log("track!");
- });
- setInterval(function() {
- var idx = divs.filter('.selected').index();
- tarr[idx] = tarr[idx] + delay;
- output.text('Times (in ms): ' + tarr);
- //console.log('Times (in ms): ' + tarr);
- }, delay);
- $(function(){
- $("#test").on("submit", function(event) {
- event.preventDefault();
- console.log('Times (in ms): ' + tarr);
- tarrString = tarr.toString();
- $.ajax({
- url: "next.php",
- type: "post",
- data: {tarr: tarrString},
- dataType: "text",
- success: function(d) {
- //alert(d);
- }
- });
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement