Skip to content

Instantly share code, notes, and snippets.

@peterberwind
Last active November 25, 2016 00:23
Show Gist options
  • Save peterberwind/315271eeae4ad56cbc15adc7e933af16 to your computer and use it in GitHub Desktop.
Save peterberwind/315271eeae4ad56cbc15adc7e933af16 to your computer and use it in GitHub Desktop.
Checkout Customization
<script type="text/javascript">
function replaceText(selector, text, newText, flags) {
var matcher = new RegExp(text, flags);
$(selector).each(function () {
var $this = $(this);
if (!$this.children().length)
$this.text($this.text().replace(matcher, newText));
});
}
function replaceAllText() {
setTimeout(function(){
replaceText('*', '#E42000', 'red', 'g');
replaceText('*', '#FED5DA', 'pink', 'g');
replaceText('*', '#D8F3FA', 'blue', 'g');
}, 1000);
}
$(document).ready(replaceAllText);
$('html').ajaxStop(replaceAllText);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment