Skip to content

Instantly share code, notes, and snippets.

@joshdcomp
Created February 5, 2015 20:21
Show Gist options
  • Save joshdcomp/d13309b16ebe4a2c766a to your computer and use it in GitHub Desktop.
Save joshdcomp/d13309b16ebe4a2c766a to your computer and use it in GitHub Desktop.
code questions
function Bling(ice){
this.ice = ice;
this.thing();
$('.do_thing').on('click', function(){
console.log(this.ice);
});
}
Bling.fn = Bling.prototype;
Bling.prototype.thing = function(){
console.log('hey');
}
Bling.fn.thing = function(){
console.log('sup');
}
$(function(){
var ring = new Bling('ring');
});
/*
* <div class="hey">
* <p class="sup">Sup, man</p>
* <p class="different">Dude, I'm like, different</p>
* <p>Some cool text here.</p>
* </div>
*
* - .hey should have 20px of padding on all sides and a width of 200px
* - all paragraphs in .hey should be italic, but .different should be non-italic bold
* - the last paragraph in .hey should have a top margin of 20px
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment