Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery.noConflict();
- jQuery('#ts-all').addClass('ts-current-li');
- jQuery("#ts-filter-nav > li").click(function(){
- ts_show(this.id);
- }).children().click(function(e) {
- return false;
- });
- jQuery("#ts-filter-nav > li > ul > li").click(function(){
- ts_show(this.id);
- });
- //FILTER CODE
- function ts_show(category) {
- //console.log(category);
- if (category == "ts-all") {
- jQuery('#ts-filter-nav > li').removeClass('ts-current-li');
- jQuery('#ts-all').addClass('ts-current-li');
- jQuery('.tshowcase-filter-active').show(1000);
- }
- else {
- jQuery('#ts-filter-nav > li').removeClass('ts-current-li');
- jQuery('#' + category).addClass('ts-current-li');
- jQuery('.' + category).show('slow');
- //**** New LINE **** //
- var index = jQuery('.' + category + ' a').click();
- jQuery('.tshowcase-filter-active:not(.'+ category+')').hide(1000);
- console.log(index);
- }
- }
- jQuery(document).ajaxSuccess(function() {
- jQuery('#ts-all').addClass('ts-current-li');
- jQuery("#ts-filter-nav > li").click(function(){
- ts_show(this.id);
- }).children().click(function(e) {
- return false;
- });
- jQuery("#ts-filter-nav > li > ul > li").click(function(){
- ts_show(this.id);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment