Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Star
9209 Points
1484 Posts
Nov 28, 2010 04:04 AM|LINK
Sorry for the late reply as the weekend keeps me away from the laptop.
But i see what you are looking at, and I have used the buttonset() plugin and redefined the sample...
View the sample below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <link href="../css/ui-lightness/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" /> <script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="../js/jquery-ui-1.8.6.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $(function () { $('#btnSet').buttonstrip(); }); ; (function ($) { $.widget("ui.buttonstrip", { chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', _init: function () { var self =this; var initElem = self.element; var aBtn = $('<input />') .attr('type','radio') .attr('id',initElem.attr('id') + '_Radio_all') .attr('name',initElem.attr('id') + '_btnList') .val('-1'); initElem.append(aBtn); initElem.append(self._createLabel(aBtn,'All')); for (var i = 0; i < chars.length; i++) { var input = $('<input />') .attr('type','radio') .attr('id',initElem.attr('id') + '_Radio' + i) .attr('name',initElem.attr('id') + '_btnList') .val(i); initElem.append(input); initElem.append(self._createLabel(input,this.chars[i])); } initElem.buttonset(); }, _createLabel: function(forElem,text) { return $('<label />') .text(text) .attr('for',$(forElem).attr('id')); } }); })(jQuery); </script> </head> <body> <div id="btnSet"></div> </body> </html>
nvanhaaster@...
Star
9209 Points
1484 Posts
Re: JQuery Toggle Button
Nov 28, 2010 04:04 AM|LINK
Sorry for the late reply as the weekend keeps me away from the laptop.
But i see what you are looking at, and I have used the buttonset() plugin and redefined the sample...
View the sample below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <link href="../css/ui-lightness/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" /> <script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="../js/jquery-ui-1.8.6.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $(function () { $('#btnSet').buttonstrip(); }); ; (function ($) { $.widget("ui.buttonstrip", { chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', _init: function () { var self =this; var initElem = self.element; var aBtn = $('<input />') .attr('type','radio') .attr('id',initElem.attr('id') + '_Radio_all') .attr('name',initElem.attr('id') + '_btnList') .val('-1'); initElem.append(aBtn); initElem.append(self._createLabel(aBtn,'All')); for (var i = 0; i < chars.length; i++) { var input = $('<input />') .attr('type','radio') .attr('id',initElem.attr('id') + '_Radio' + i) .attr('name',initElem.attr('id') + '_btnList') .val(i); initElem.append(input); initElem.append(self._createLabel(input,this.chars[i])); } initElem.buttonset(); }, _createLabel: function(forElem,text) { return $('<label />') .text(text) .attr('for',$(forElem).attr('id')); } }); })(jQuery); </script> </head> <body> <div id="btnSet"></div> </body> </html>My .Net Blog
My Links are shrunk by t-ny.co