Thursday, July 6, 2017

14 jQuery Live Search Plugins

A live search is an enhanced search form that uses AJAX technology to deliver results or suggestions within the same view. This is different from a regular HTML input field that is given autocomplete powers from a modern browser like Chrome, Firefox or Safari. A live search is often an input field that has been programmed to load suggestions from a specific dataset.

July 6th, 2017: This article was rewritten to update the list of plugins, and include some bonus, non-jQuery libraries.

Using live search in your application greatly improves the user friendliness of your site. Whatever back-end technology you are using -- PHP, Java, Python, Ruby -- JavaScript is your best bet in implementing a client-side live search feature.

Before I proceed, I would like to point out that the term live search is a bit ambiguous. There's no authoritative definition for that term. Other terms that are frequently used to mean the same thing are autocomplete and type ahead.

I've come across a number of solutions labeled as live search which lack certain critical features. For this article, I'll only shortlist live search solutions that fit the definition I've defined above.

1. Ajax Live Search

Ajax Live Search

The first one on this list is a pretty amazing open-sourced, live search jQuery plugin. It is well documented and works perfectly in Chrome, Firefox, Safari, Opera, and IE8. The most impressive feature is that it can return results in the form of a paginated table! How cool is that?

You can learn more about it in the following links:

2. Semantic UI Search Component

Semantic-UI Search

If you are into CSS frameworks, you should check out Semantic UI. They have a cool Search Component that allows you to implement live search on your forms very easily. Just take a look at this example code:

HTML:

<div class="ui search">
  <input class="prompt" type="text" placeholder="Search GitHub...">
  <div class="results"></div>
</div>

JavaScript:

$('.ui.search')
  .search({
    apiSettings: {
      url: '//api.github.com/search/repositories?q={query}'
    },
    fields: {
      results : 'items',
      title   : 'name',
      url     : 'html_url'
    },
    minCharacters : 3
  })
;

It's amazingly minimal yet powerful. If you use the API settings option, you can do customizations such as grouping results into categories!.

Semnatic-UI Search Grouping Search

Semantic UI also comes in different flavors specifically built for React, Meteor, Ember, and Angular. Check out their integrations page for the full list.

To learn more, visit the following links.

3. jQueryUI Autocomplete

jQueryUI Autocomplete

This is a jQuery widget that is part of the jQuery UI library. The library itself is a curated set of user interface components, effects, and themes built on top of jQuery.

Autocomplete comes with several templates to provide different implementations. Here is one such example:

HTML:

<div class="ui-widget">
  <label for="birds">Birds: </label>
  <input id="birds">
</div>

<div class="ui-widget" style="margin-top:2em; font-family:Arial">
  Result:
  <div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
</div>

JavaScript:

$( function() {
  function log( message ) {
    $( "<div>" ).text( message ).prependTo( "#log" );
    $( "#log" ).scrollTop( 0 );
  }

  $( "#birds" ).autocomplete({
    source: "search.php",
    minLength: 2,
    select: function( event, ui ) {
      log( "Selected: " + ui.item.value + " aka " + ui.item.id );
    }
  });
} );

To learn more, visit the following links:

4. DevBridge jQuery AutoComplete

Devbridge Autocomplete

The DevBridge jQuery AutoComplete is a tiny JavaScript library that allows you to turn regular text input fields into autocomplete suggestion boxes. Its API is vast and well documented allowing you to perform quite a number of different configurations. Implementing it is quite simple, check out this example:

HTML:

<input type="text" name="country" id="autocomplete"/>

JavaScript(AJAX lookup):

// AJAX Lookup
$('#autocomplete').autocomplete({
    serviceUrl: '/autocomplete/countries',
    onSelect: function (suggestion) {
        alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
    }
});

JavaScript(Local lookup):

var countries = [
   { value: 'Andorra', data: 'AD' },
   // ...
   { value: 'Zimbabwe', data: 'ZZ' }
];

$('#autocomplete').autocomplete({
    lookup: countries,
    onSelect: function (suggestion) {
        alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
    }
});

To learn more, visit the following link:

5. EasyAutocomplete

EasyAutocomplete

EasyAutocomplete is a highly customizable jQuery autocomplete plugin with all the commonly required features. It supports local and remote data sets in JSON, XML, and plain text formats. It also supports callback handlers along with some default styling.

What sets this plugin apart is their templates feature. Templates are used to define the results view. You can create a custom template or use one of the available built-in presets which include:

  • Description Template
  • Icon Right/Left Template
  • Link Template

Continue reading %14 jQuery Live Search Plugins%


by Michael Wanyoike via SitePoint

10 Best iOS Game Templates

A Friendly Introduction to Flexbox for Beginners

Flexbox Tutorial

This is the updated version of an article published on 4th February 2013. Updates include:rewriting paragraphs and sections to fit new developments in browser support for flexbox and in CSS with the advent of Grid Layout, creating live demos on CodePen, modifying code snippets, title change, adding a featured image, and a few grammatical changes.

Do you remember when tables were the only layout method for a website? At least until people realized that it’s a semantic nightmare to misuse something that’s actually reserved to display tabular data for the structure of an internet site. So a new “tool” needed to be found and soon floats and absolute positioning were discovered as a "proper" replacement.

Just like tables, of course, the true purpose of these two methods wasn’t to give websites a shape.

Only recently, major browsers have provided support for CSS Grid Layout, a robust layout engine built into CSS. You could use Grid in production websites right now, provided you cater for non supporting browsers with appropriate fallbacks.

A great fallback strategy is to serve flexbox-based (or “Flexible Box Layout Module” as the W3C likes to call it) layouts to all browsers without support for Grid Layout. This works great in most cases, since today flexbox has excellent browser support across the board.

Advantages of Using Flexbox

Some of the advantages of flexbox are:

  • Page content can be laid out in any direction (to the left, to the right, downwards or even upwards)
  • Bits of content can have their visual order reversed or rearranged
  • Items can “flex” their sizes to respond to the available space and can be aligned with respect to their container or each other
  • Achieving equal-column layouts (irrespective of the amount of content inside each column) is a breeze.

To illustrate the various properties and possibilities let’s assume the following simple layout for some of the demos in this article:

[code language="html"]
<div class="example">
<header>
header content here
</header>
<main class="main">
<nav>
nav content here
</nav>
<div class="content">
main content here
</div>
<aside>
aside content here
</aside>
</main>
<footer>
footer content here
</footer>
</div>
[/code]

The first step is to place the elements within .main, i.e., <nav> and <aside>, side by side. Without flexbox we’d probably float all the three elements, but making it work as desired wouldn't be very straightforward. Moreover, the traditional way of doing things would present a well-known problem: every column is just as high as its content. As a consequence, you would need to set an equal height for all three columns to have the same length, or use some sort of hack.

Enter flexbox to the rescue.

Let’s Flex

The core element of flexbox is the new flex value of the display property, which needs to be set for the container element. Doing so turns its children into “flex items”. These items acquire some handy properties by default. For example, they get placed side by side, and elements without a specified width automatically take up the remaining space.

So, if you set display: flex for .main, its .content child element is automatically squeezed in between <nav> and <aside>. No more calculations, how handy is that? As a special bonus, all of these three elements magically have the same height.

[code language="css"]
.main {
display: flex;
}
[/code]

Check out the demo below for all the details:

See the Pen Flexbox Tutorial: Display Property by SitePoint (@SitePoint) on CodePen.

The Order of Things: Flexbox order Property

Another property of flexbox is the ability to easily change the order of elements. Let’s assume you've built the above layout for a client and she now wants .content to come before <nav>.

Normally, you'd dive into the HTML source code and change the order there. With flexbox you can accomplish the task entirely with CSS. Just set the order property of .content to -1 and the content column will come first.

[code language="css"]
.main {
display: flex;
}

.content {
order: -1;
}
[/code]

In this case you don’t need to state the order for the other columns:

See the Pen Flexbox Tutorial: Order Property by SitePoint (@SitePoint) on CodePen.

If you prefer to specify the value of the order property explicitly for each column instead, you can go ahead and set order to 1 for .content, to 2 for <nav> and to 3 for <aside>.

Continue reading %A Friendly Introduction to Flexbox for Beginners%


by Christian Krammer via SitePoint

Orazio Cantio Photographer

Orazio Cantio, Photographer based in Cilento. Portrait, Children, Street Photography, Glamour, Fashion, Couples.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Nick Vandermolen

Portfolio of Nick Vandermolen, Senior Digital Designer from Sydney, Australia. I specialise in User Experience (UX), User Interface (UI) and Digital Art Direction.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Casearia Bresciana Ca.Bre. s.c.a.

Ca.Bre, since 1954 a successful example of cooperative dairy industry.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

TeaLao

TeaLao – is a project about Chinese and Japanese tea ceremony. We have been studying tea since 2012 and we have collected enough knowledge to share it among other people. Our religion is objectivity and we try really hard to confirm every concept we


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery