HTML and CSS Reference
In-Depth Information
channel.bind('close', function(data){ room.close(data); });
channel.bind('open', function(data){; });
channel.bind('ask', function(data){ question.ask(data); });
channel.bind('vote', function(data){; });
channel.bind('answer', function(data){ });
var nonce = $('input[name=nonce]:eq(0)').val(),
room = {
open: function(data){
close: function(data){
question = {
ask: function(data){
vote: function(data){
var question = $('#question-'+data.question_id),
cur_count ='count'),
new_count = cur_count+1;
// Updates the count
.attr('data-count', new_count)
.data('count', new_count)
setTimeout(1000, function(){
Testing Out the Animation
To see this in action, use two browsers to join a room—make sure neither browser is the presenter—and place them
side-by-side so you can see both at once.
In one browser, ask a new question; it will be dynamically added to the other browser window when the ask event
is triggered.
In the other browser, vote up the new question. Watch the first browser as you submit the vote: it will run through
the animation before returning to its normal state. It's difficult to demonstrate this in a still image, but Figure 10-8
shows the animation in progress.
Search WWH ::

Custom Search