This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Popcorn('#video') | |
.play() | |
.currentTime(30) | |
.pause() | |
.listen('timeupdate', function(event){ | |
console.log( this ) // the current popcorn object | |
this.currentTime() // the currentTime | |
}) | |
.play() | |
.currentTime(20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Outline code for the popcornjs enhanced singleton pattern | |
*/ | |
// Immediately invoked function expression is used to | |
// create a pseudo-private scope for our api definition | |
// a reference to the `window` object is passed into the | |
// closure and referenced as `global`. This is both | |
// beneficial for compressors and provides a fast | |
// reference to the window context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Popcorn Instance Methods | |
var p = Popcorn( "#video" ) | |
p.play() | |
// Play the video (Native "pass through" method) | |
// Returns the Popcorn instance object | |
p.load() | |
// Load the video (Native "pass through" method) | |
// Returns the Popcorn instance object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
// Twitter REST API list method | |
$.getJSON('http://twitter.com/F1LT3R/lists/bocoup/statuses.json?callback=?', function(tweets){ | |
console.log('Twitter REST API results:', tweets); | |
// This will log an array of objects each representing one twitter post. | |
// Each object in the array will contain on tweet that looks like this. | |
/* | |
[ | |
Object, | |
Object : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('selector').twitter('search terms'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Twitter Search Plugin</title> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<script src="jquery.twitter.js"></script> | |
<style type="text/css"> | |
.twitter-posts li {margin-bottom: 10px; font-size: 12px; clear: both; list-style-type:none;} | |
.twitter-posts li img {float:left; width: 48px; margin:0px 10px 10px 0px;border:1px solid #c2c2c2; -moz-box-shadow: 0px 0px 4px #c2c2c2; -webkit-box-shadow: 0px 0px 4px #c2c2c2; box-shadow: 0px 0px 4px #c2c2c2;} | |
.twitter-posts li a {text-decoration:none; color: #009;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Dead Simple Twitter Search API jQuery Feed</title> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<script src="jQuery.twitterFeed.js"></script> | |
<link href="jQuery.twitterFeed.css" media="screen" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<h1>Twitter Posts:</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Usages: | |
$(selector).classList() //returns an array of classnames | |
$(selector).classList('newclass') //replaces the current element's classes | |
$(selector).classList('new', 'class', 'names') //replaces the current element's classes | |
$(selector).classList(['new', 'class', 'names']) //replaces the current element's classes | |
*/ | |
jQuery.fn.extend({ | |
classList: function( value ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//based on the source of http://g.raphaeljs.com/linechart.html | |
var options = { | |
axis: "0 0 1 1", // Where to put the labels (trbl) | |
axisxstep: 16 // How many x interval labels to render (axisystep does the same for the y axis) | |
}; | |
document.addEventListener('DOMContentLoaded', function () { | |
// Make the raphael object |
NewerOlder