jQuery Google Search Newsbar Reference

A jQuery plugin that sets a division to show a Google Search Newsbar. If you find this plugin useful please vote for it on the jQuery site.

This page provides a documentation reference for working with the plugin v1.0.2. See a demonstration of the Google Search Newsbar plugin and download the code from there.

For more detail on the Google Search Newsbar functionality, see the Google API documentation.

Instance Settings

A separate GSNewsbar instance is created for each targetted division and has its own settings:

$('divs').gsnewsbar({...});

currentResult | cycleMode | cycleTime | horizontal | linkTarget | manyResults | search | title | verticalCompressed

NameTypeDefaultComments
horizontalbooleantrue Controls the orientation of the newsbar, being horizontal (true) or vertical (false).
verticalCompressedbooleanfalse Controls the how much detail is shown for a vertical newsbar, being titles only (true) or all details (false). Note that this setting has no effect on horizontal newsbars.
titlestring'' The title of the newsbar. It only appears at the top of a vertical newsbar.
searchstring or string[]'jquery' The single term to search for, or a list of terms to cycle through.
manyResultsbooleanfalse Control how many results are returned, being few (false) or many (true).
cycleTimeenumeratedthis.cycleManual Specify the interval between cycles when multiple search terms are provided. For horizontal newsbars this is the time between individual entries, whereas for vertical newsbars it is the time between results for multiple search terms. Use one of $.gsblogbar.cycleVShort (3 seconds), $.gsblogbar.cycleShort (3 seconds horizontal, 10 seconds vertical), $.gsblogbar.cycleMedium (5 seconds horizontal, 15 seconds vertical), $.gsblogbar.cycleLong (10 seconds horizontal, 30 seconds vertical), $.gsblogbar.cycleManual (5 seconds horizontal, indefinite vertical).
cycleModeenumeratedthis.cycleLinear Specify the order in which search terms are used when multiple are provided. Use either $.gsnewsbar.cycleRandom or $.gsnewsbar.cycleLinear.
linkTargetenumeratedthis.targetSelf Indicate in which window a news entry should open. Use one of $.gsnewsbar.targetSelf (the current window), $.gsnewsbar.targetBlank (a new window), $.gsnewsbar.targetTop (replacing all frames), or $.gsnewsbar.targetParent (the frameset parent window).
currentResultstring, object, element'' The jQuery selector, jQuery object, or individual element for the a container to show details about the current newsbar entry. If more than one element is selected, only the first is used. Note that this setting only applies to horizontal newsbars.

Functions

SignatureReturnsComments
$.gsnewsbar.setDefaults(settings)GSNewsbar object Update the default instance settings to use with all GSNewsbar instances.
$(div).gsnewsbar('change', settings)jQuery object Update the settings for the GSNewsbar instance(s) attached to the given div(s).
$(div).gsnewsbar('destroy')jQuery object Remove the GSNewsbar functionality from the given div(s).
$(div).gsnewsbar('search', terms)jQuery object Execute a new search for the GSNewsbar.
terms (string) the keywords to search for.

Contact Keith Wood at kbwood{at}iinet.com.au with comments or suggestions.


Valid HTML 4.01 Strict