Skip to content

Instantly share code, notes, and snippets.

@omurphy27
Created April 21, 2015 18:58
Show Gist options
  • Save omurphy27/e940b80ac97c6cf30ba9 to your computer and use it in GitHub Desktop.
Save omurphy27/e940b80ac97c6cf30ba9 to your computer and use it in GitHub Desktop.
Jquery - create element with append and custom CSS on the fly.js
// credit: http://stackoverflow.com/questions/12143106/create-element-in-jquery
$("<div/>",{
"class" : "circle " + $color,
// .. you can go on and add properties
"css" : {
"width" : $width,
"height" : $width,
"left" : $left,
"top" : $top
}
}).appendTo($circleContainer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment