Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery.noConflict();
- jQuery( document ).ready(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);
- });
- });
- //FILTER CODE
- function ts_show(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');
- jQuery('.tshowcase-filter-active:not(.'+ category+')').hide(1000);
- }
- //hack to solve menu left open on touch devices
- if(is_touch_device()) {
- jQuery('ul li ul li.ts-current-li')
- .parent()
- .hide()
- .parent()
- .on('click', function(){
- jQuery(this).addClass('ts-current-li')
- .children().show();
- });
- }
- }
- function is_touch_device() {
- return (('ontouchstart' in window)
- || (navigator.MaxTouchPoints > 0)
- || (navigator.msMaxTouchPoints > 0));
- }
- 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