Dynamic Breadcrumbs Need
Posted: 24 Apr 2016, 16:39
Hi, I am trying implement a dynamic breadcrumbs for Volt theme. But I am facing several problems. I am trying to use Jquery to read menuitem value like bellow:
<div class="breadcrumb">
<div class="item"><a href="#home">Home / </a></div>
</div>
And Mainly JS is:
$('.items a').on('click', function() {
var $this = $(this),
$bc = $('<div class="item"></div>');
$this.parents('li').each(function(n, li) {
var $a = $(li).children('a').clone();
$bc.prepend(' / ', $a);
});
$('.breadcrumb').html( $bc.prepend('<a href="#home">Home</a>') );
return false;
})
It works nice and displays menu value dynamically, But problem is this, when I click menuitem that contain action and then page reloads and clear the breadcrumbs.
Please advise. Any idea.
<div class="breadcrumb">
<div class="item"><a href="#home">Home / </a></div>
</div>
And Mainly JS is:
$('.items a').on('click', function() {
var $this = $(this),
$bc = $('<div class="item"></div>');
$this.parents('li').each(function(n, li) {
var $a = $(li).children('a').clone();
$bc.prepend(' / ', $a);
});
$('.breadcrumb').html( $bc.prepend('<a href="#home">Home</a>') );
return false;
})
It works nice and displays menu value dynamically, But problem is this, when I click menuitem that contain action and then page reloads and clear the breadcrumbs.
Please advise. Any idea.