I have a function that I can call to apply a rounded corner correction to the button.button, button.ui-button, input.button and input.ui-button 'button, which simply adds a div next to the element and then wraps the whole batch in another div.
It works great when loading a page, but I had to make a function that I could call to fix buttons that were not available when loading the page.
$(document).ready(function(){
$('input.button:visible, button.button:visible, input.ui-button:visible, button.ui-button:visible').after('<div class="button-right"></div>').wrap('<div class="button-wrapper" />');
$('input.button-large:visible, button.button-large:visible').after('<div class="button-large-right"></div>').wrap('<div class="button-large-wrapper" />');
});
function CheckIEButtons(){
$("input.button:visible:not(div.button-wrapper),button.button:visible:not(div.button-wrapper)").after('<div class="button-right"></div>').wrap('<div class="button-wrapper" />');
$("input.ui-button:visible:not(div.button-wrapper),button.ui-button:visible:not(div.button-wrapper)").after('<div class="button-right"></div>').wrap('<div class="button-wrapper" />');
$("input.button-large:visible:not(div.button-large-wrapper),button-large.button:visible:not(div.button-large-wrapper)").after('<div class="button-large-right"></div>').wrap('<div class="button-large-wrapper" />');
}
So, I basically want to select all the buttons / inputs with the corresponding class that ARE are visible but NOT in the wrapper of the div.
Whenever I call a function at the moment, its adding divs regardless of whether it is already in one.