jQuery UI Button loses CSS Styling when called using $.get() and .html() -
I have some jQuery scripts using a jQuery UI button:
& Lt; Script type = "text / javascript" & gt; $ ('Button) .button (); // Set jQuery UI button style $ ('# btnclose'). Live ('click', function () $ $ .get ('content.html', function (data) {$ ('# EditCategory') .html (data);});}); & Lt; / Script & gt; & Lt; Html & gt; & Lt; Button type = "button" id = "btnclose '" & gt; Close & lt; / Button & gt; & Lt; Div id = "editcategory" category = "range" & gt; & Lt; / Div & gt; & Lt; / Html & gt;
I have content.html page:
& lt; Button type = "button" id = "btnNewCategory" & gt; Add new category & lt; / Button & gt;
When I click on #btnClose, content.html is returned and the button is displayed, but the jquery ui css styling is lost. Is it because COS style is implemented before the reconstruction of the DOM? If so, then I can do anything like that. To implement CSS () to use.
Thanks for the help!
After you include that content, you need to apply the button style to that content:
< Pre> $ ('# btnclose'). ('Click', function () {$ .get ('content.html', function (data) {$ ('# editcategory') .html (data); $ ('# editcategory button'). Button () malicious As such, there is no analog to implementing plugins. The technique uses is useful only for capture and handling events.
Comments
Post a Comment