Created
November 22, 2015 06:48
-
-
Save joeSaad/b8a956ffe81a7ad49b0e to your computer and use it in GitHub Desktop.
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
<style> | |
.tech-name span { | |
border:1px solid #eee; | |
padding: 4px; | |
background-color: lightgrey; | |
border-radius: 2px; | |
box-shadow: 2px 2px 2px #aaa; | |
} | |
.tech-name span:hover { | |
background-color: #eee; | |
cursor: pointer; | |
} | |
</style> | |
<div class="tech-name">PHP, Classic ASP, Python, Perl</div> | |
$('.tech-name').each(function() { | |
var words = $(this).text().split(','); | |
$(this).empty().html(function() { | |
for (i = 0; i < words.length; i++) { | |
if (i == 0) { | |
$(this).append('<span>' + words[i] + '</span>'); | |
} else { | |
$(this).append(' <span>' + words[i] + '</span>'); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment