c# - Client side alphabetic multi-column (lists) sorting and filtering -
i have index of "services" quite large, , trying make user friendly.
the current display 4 columns (four unordered lists, @ moment) displays alphabetically top bottom, left right so:
ab co en ac ce de fa af ci ef gu these lists built in c# code behind, bulletedlist controls attached containing panel control on page load.
the number of items has become large enough want make use of filtering giving list across top # b c d... etc, , when click on it, filter results. want accomplish using javascript, , avoiding post backs.
my initial thought have javascript (jquery) .show() , .hide() ones necessary, current unordered list arrangement, struggling how accomplish , maintain alphabetic layout.
for example, using 4 unordered lists example above, filtering result in this:
ab ac af instead of spanning across columns.
taking thought further, considered using single unordered list , having list items float left span across screen , down -- issue run sorting alphabetically down first , across, because sorts across first , down.
additionally, using float left method causes link spans 2 lines cause line break links across row, resulting in odd gaps.
i realize long winded , specific question, assistance on how accomplish code, html/css formatting, or suggestions better way of doing appreciated! taking time read question.
it sounds might want use 1 of jquery portfolio plugins.
here's 1 example: http://webdesigntunes.com/coding/jquery-filterable-portfolio/
you create html tagged classes matching want sort on
<nav class="primary clearfix"> <ul> <li><a href="#" class="selected" data-filter="*">all</a></li> <li><a href="#" data-filter=".web">web design</a></li> <li><a href="#" data-filter=".ill">ilustration</a></li> <li><a href="#" data-filter=".logo">logo</a></li> <li><a href="#" data-filter=".video">video</a></li> <li><a href="#" data-filter=".print">print design</a></li> </ul> </nav> <section class="main"> <div class="portfolio"> <article class="entry video"> <a data-rel="prettyphoto" href="http://vimeo.com/34266952"> <img src="images/portfolio/work1.jpg" alt=""> <span class="video-hover"></span> </a> </article> <article class="entry web"> <a data-rel="prettyphoto" href="images/portfolio/work2.jpg"> <img src="images/portfolio/work2.jpg" alt=""> <span class="magnifier"></span> </a> </article> </section> apply .css ect.
then use isotope sorting
var $container = $('.portfolio'); $container.isotope({ filter: '*', animationoptions: { duration: 750, easing: 'linear', queue: false, } }); $('nav.primary ul a').click(function(){ var selector = $(this).attr('data-filter'); $container.isotope({ filter: selector, animationoptions: { duration: 750, easing: 'linear', queue: false, } }); return false; }); var $optionsets = $('nav.primary ul'), $optionlinks = $optionsets.find('a'); $optionlinks.click(function(){ var $this = $(this); // don't proceed if selected if ( $this.hasclass('selected') ) { return false; } var $optionset = $this.parents('nav.primary ul'); $optionset.find('.selected').removeclass('selected'); $this.addclass('selected'); }); check out demo , see if that's you're needing: http://webdesigntunes.com/tutorial/filterable/
Comments
Post a Comment