The Goal:
Sometimes you might want to replace text with an icon in the navigation, or replace the verbiage output of a particular word.

Requirements:

Before

After

jQuery

Add this to your custom scripts.

[cc lang=”javascript”]
// Trim Navigation with Icon
$( “.item_text” ).each(function() {
//get the text for just the element being iterated over
var text = $(this).text();
var comparingText = ‘Location’;

if(text == comparingText){
$(this).replaceWith(““);
}
});
[/cc]

HTML

This is an example of the kind of element you might target.

[cc lang=”html”]
Location
[/cc]
Share This