Skip to content

Instantly share code, notes, and snippets.

View huytoan's full-sized avatar

Louis Nguyen huytoan

View GitHub Profile
@huytoan
huytoan / Flip a Button
Created January 30, 2012 12:35
flip a uibutton
- (void) viewDidLoad{
[super viewDidLoad];
isFrontViewShowing = YES;
UIButton *flipBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
flipBtn.frame = CGRectMake(100, 100, 100, 40);
[flipBtn setTitle:@"Front" forState:UIControlStateNormal];
[flipBtn addTarget:self action:@selector(flipBtnTapped:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:flipBtn];
@huytoan
huytoan / loadexternalcss.js
Created November 25, 2010 12:04
load external js/css file
function loadjscssfile(filename, filetype){
if (filetype=="js"){ //if filename is a external JavaScript file
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", filename)
}
else if (filetype=="css"){ //if filename is an external CSS file
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")