javascript - Global footer in typeahead dropdown -
i have typeahead menu 2 categories, under categories need button. how can add global footer, available when 2'nd category missing?
what did add footer in each dataset hide last 1 css, here's code :
$('#search-query').typeahead([ { remote: appurl + 'franchiseesuggestions?query=%query', name: 'franchisees', minlength: 3, valuekey: 'name', template: [ '<p><strong>{{name}}</strong></p>' ].join(''), header: '<p class="tt-header">' + franchisees + '</p>', footer: '<p class="more"><a href="/recherche?q=%query">all results</a></p>', engine: hogan }, { remote: appurl + 'citysuggestions?query=%query', name: 'cities', minlength: 3, valuekey: 'name', template: [ '<p><strong>{{name}}</strong></p>' ].join(''), header: '<p class="tt-header">' + cities + '</p>', footer: '<p class="more"><a href="/recherche?q=%query">all results</a></p>', engine: hogan } ])
and css magic :
.tt-dropdown-menu .more{ display:none; } .tt-dropdown-menu div:last-child .more { display:block; }
hope helps!
Comments
Post a Comment