Created
March 15, 2018 09:10
-
-
Save vladanyes/116f0461aab8cce7b44febe853d3336d 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
Drupal.behaviors.listWords = { | |
attach: function () { | |
$.fn.paintFirstWord= function(color) { | |
var str = this.text(); | |
var splited = str.split(' '); | |
var replaced = str.split(splited[0]).join('<span style = "color:' + color + ';font-weight:bold">' + splited[0] + '</span>'); | |
this.html(replaced); | |
}; | |
$('.pane-fpid-136 li').each( function() { | |
$(this).paintFirstWord('#e31d34'); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment