{"id":28,"date":"2014-10-10T01:28:34","date_gmt":"2014-10-09T19:58:34","guid":{"rendered":"http:\/\/subashselvaraj.com\/?p=28"},"modified":"2025-06-22T07:38:20","modified_gmt":"2025-06-22T07:38:20","slug":"jquery-plugin-for-expanding-search-input","status":"publish","type":"post","link":"https:\/\/subashselvaraj.com\/index.php\/2014\/10\/10\/jquery-plugin-for-expanding-search-input\/","title":{"rendered":"jQuery plugin for expanding search bar"},"content":{"rendered":"<p>I have created a jQuery plugin to handle expand and close functionality of searchbar. This would help some to minimize their work, since it is straight forward to use.<\/p>\n<p>Download the files from <a title=\"jQuery Searchbox\" href=\"https:\/\/github.com\/sesubash\/searchbox\" target=\"_blank\" rel=\"noopener\">github<\/a>.<\/p>\n<p>Add javascript ( jquery.searchbox.js ) and css ( searchbox.css ) files in&nbsp;your html document. Create a div in your document and initiate the plugin.<\/p>\n<pre class=\"brush:html\"> &lt;div class=\"search\"&gt;&lt;\/div&gt;<\/pre>\n<p>Plugin Initiation:<\/p>\n<pre class=\"brush:js\">$(\".search\").searchbox({\n    name: \"search\",\n    method: \"POST\",\n    url: \"someurl.php\",\n    placement: \"right\",\n    ajax: true,\n    ajaxOptions: {\n        success: function(success){\n            alert(success);\n        },\n        error: function(error){\n            alert(error);\n        }\n    }\n});<\/pre>\n<p>Demo:<br \/>\n[iframe src=&#8221;http:\/\/jsfiddle.net\/Lw3CN\/24\/embedded\/result\/&#8221; width=&#8221;100%&#8221; height=&#8221;480&#8243; allowfullscreen=&#8221;allowfullscreen&#8221; frameborder=&#8221;0&#8243;]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have created a jQuery plugin to handle expand and close functionality of searchbar. This would help some to minimize their work, since it is straight forward&#8230; <\/p>\n","protected":false},"author":1,"featured_media":229,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_mi_skip_tracking":false,"_themeisle_gutenberg_block_has_review":false},"categories":[4,5,16],"tags":[17,13,14,18],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/posts\/28"}],"collection":[{"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":16,"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions\/230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/media\/229"}],"wp:attachment":[{"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/subashselvaraj.com\/index.php\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}