jBreadCrumb: 0.3.0

on Thursday, December 24, 2009

http://code.google.com/p/jbreadcrumb/

jBreadCrumb gains the ability to start working in a Web 2.0 world. The addition of methods for ‘add’, ‘remove’, and ‘clear’ allows for a webpage which dynamically loads content into a sub-div or iframe to also update the breadcrumb trail. It’s definitely not perfect, but allows for breadcrumbs to start becoming a dynamic part of the webpage design.

The new methods can be used by:

(*note: #addBreadCrumb, #removeBreadCrumb, and #clearBreadCrumb are input buttons on the page. #breadCrumbAdd is the breadcrumb list element to update.)

Add:

The options are:

  • text: (required) the text to display on screen.
  • url: (optional, default: ‘#’) the url to apply to the hyperlink
  • index: (optional, default: add the breadcrumb to the end of the list) the position to place to breadcrumb (1 based index)
$('#addBreadCrumb').click(function(e) {
var options = {
text: $('#addDisplayValue').val(),
url: $('#addUrl').val(),
index: $('#addIndex').val()
};

$('#breadCrumbAdd').jBreadCrumb('add',options);

e.preventDefault();
});

Remove:

The options are:

  • index: (optional, default: the last breadcrumb) the position to remove (1 based index)

$('#removeBreadCrumb').click(function(e) {
var options = {
index: $('#removeIndex').val()
};
$('#breadCrumbAdd').jBreadCrumb('remove',options);
e.preventDefault();
});

Clear:

$('#clearBreadCrumb').click(function(e) {
$('#breadCrumbAdd').jBreadCrumb('clear');
e.preventDefault();
});

These functions are useful for my usages. But, do they do what you need?

0 comments:

Post a Comment


Creative Commons License
This site uses Alex Gorbatchev's SyntaxHighlighter, and hosted by herdingcode.com's Jon Galloway.