HTML and CSS Reference
In-Depth Information
// Set the contents of the search results div
_searchresultscard.innerHTML = '';
_searchresultscard.appendChild(view.render());
// Controlling page needs to be handled by it's own utility or class
_searchresultscard.classList.add('active');
_searchfield.classList.remove('loading');
results = null;
// Check to see whether the search scroll is null
if(_searchScroll !== null){
// If it isn't, destroy it
_searchScroll.destroy();
_searchScroll = null;
}
// Initialize the search scroll for the results card
_searchScroll = new iScroll(_searchresultscard);
}
...
}
As you can see, a JavaScript library called iScroll handles the scrolling
functionality. Android browsers below Honeycomb do not support overflow,
hidden in CSS, so iScroll is used to facilitate this. You will need to download the
latest version of iScroll and place it in the js/lib/cubiq folder (create the
directory, if it doesn't already exist). Name the file iscroll.js .
Viewing a Movie
In order to view a movie, you will need to make a request for the movie info from
Rotten Tomatoes and then process the results with an event handler within the
controller. Add the following code to the controller.
var app = app || {};
app.controller = app.controller || {};
app.controller.movies = function(){
...
this.find = function(data){
// Check to see whether the ID exists in the action params/data
if(typeof data.id === 'undefined'){
throw "No ID supplied to find action in view controller";
return;
 
Search WWH ::




Custom Search