I have several set radio buttons, which are used to set options, one click on specific people, others The default functionality is selected by clicking event handlers, the functionality works perfectly, but there is a problem in the view position of the button.
I am using the method to improve the aesthetics of jQueryUI., And when I trigger the .click () event programmatically, the button has not changed the state visually The current options may differ compared to existing options on the screen.
Sample code to clarify the problem:
& lt; Fieldet & gt; & Lt; Label = "button1" & gt; Button 1 & lt; / Label & gt; & Lt; Input type = "radio" id = "button1" name = "test" /> & Lt; Label = "button2" & gt; Button 2 & lt; / Label & gt; & Lt; Input type = "radio" id = "button2" name = "test" /> & Lt; / Fieldset & gt; $ ('Fieldset') buttonset () .; $ ('# Button2'). Click (function () {warning ('button 2 clicked');}); Click on $ ('# Button2').).
I have also installed a Bela so that you can see it in action, if you wish:
As you expect, the warning box pops on the page It should be loaded as much as you want, but the button has not changed visually as it happens with user-click
any thoughts?
You can click on the actual label set, like this:
$ ('[for = button2]'). Click ();
This works because your structure looks like this .buttonset ()
:
gt; & Lt; Span class = "ui-button-text" & gt; Button 2 & lt; / Span & gt; & Lt; / Label & gt; & Lt; Input type = "radio" id = "button2" name = "test" category = "ui-helper-hidden-accessible" & gt; & Lt; / Fieldset & gt;
This does not work as initially because of how the jQuery UI does it, it depends on click
< Code> & lt; Label & gt; , and the defult browser behavior is actually from & lt; Input & gt; Clicking
.
Comments
Post a Comment