Anyway, to programmatically hide the jQuery user interface?

I would like to do something like this: jQuery UI Button :

$button.button();
// ...
$button.button('hide');
// ...
$button.button('show');

How does it work enable/disable. Hiding and displaying the button manually ( $button.hide(); $button.show();) results in some really wine formatting using jQuery UI CSS ...

Did I miss something simple here?

+3
source share
6 answers

It’s just that the standard $button.hide()should be executed perfectly, what exactly does it wrap?

You can do it $button.css('display', 'none'), but that's all, $button.hide()anyway.

, , , : , . , , CSS .

+2

visibility display, . visibility: hidden ; display: none, $.hide(), DOM.

, :

var newButton = $('a#some-button.hidden');

// Hide element, but allow it to use render space
newButton.attr('visibility', 'hidden');
newButton.attr('display', 'block');

// Create button
newButton.button();

// Revert element to the "normal" means of hiding (may be unnecessary)
newButton.attr('display', 'none');
newButton.attr('visibility', 'visible');

// Show button
newButton.show();

.

+1

, , ... , , CSS, ui-helper-hidden. , , . display: , . , , . , , .

, ,

$elem.button().hide();

jQuery: , ui-helper: none.

, .

+1
**This might be easy for you:
Try this code:**
<html>
<head>
<script src="jquery.js"></script>
<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>If you click on me, I will disappear.</p>
<p>Click me away!</p>
<p><button id="demo"/>Hide me</button></p>
</body>
</html>
0

This is a workaround for me. What if jquery ui changes the implementation, then there is no guarantee.

$('#button-el').next().hide();

0
source

What worked for me:

onclick = "$ (this) .parent (). css ('display', 'none');"

0
source

All Articles