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)
1
$('#addBreadCrumb').click(function(e) {<br>    var options    = {<br>        text: $('#addDisplayValue').val(),<br>        url: $('#addUrl').val(),<br>        index: $('#addIndex').val()<br>    };<br><br>    $('#breadCrumbAdd').jBreadCrumb('add',options);<br><br>    e.preventDefault();<br>});<br>

Remove:

The options are:

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

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

Clear:

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

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.