Created
November 27, 2012 19:05
-
-
Save tmcw/4156302 to your computer and use it in GitHub Desktop.
Camelcase selectors
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> | |
<meta charset='utf-8'> | |
<title>SVG Swarm</title> | |
<style> | |
svg { | |
position: absolute; | |
top: 0; | |
} | |
</style> | |
<h2>found camelcase: <span id='camelcase'></span></h2> | |
<h2>found lowercase: <span id='lowercase'></span></h2> | |
<script src='http://d3js.org/d3.v2.min.js?2.9.1'></script> | |
<script> | |
var svg = d3.select('body').append('svg') | |
.attr('width', 100) | |
.attr('height', 100); | |
svg.append('text').append('textPath'); | |
d3.select('#camelcase').text(!svg.selectAll('textPath').empty()); | |
svg.append('text').append('textpath'); | |
d3.select('#lowercase').text(!svg.selectAll('textpath').empty()); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment