Matthew Jones
Matthew Jones

Reputation: 26190

jQuery UI interfering with Show()

I use the following code to collapse/show divs in my content page:

$(document).ready(function() {
// Hookup event handlers and execute HTML DOM-related code
$('#nameHyperLink').click(function() {

        var div = $('#nameDiv');
        var link = $('#nameHyperLink');
        if (div.css('display') == 'none') {
            link.text('Hide Data');
            div.show('100');
        }
        else {
            link.text('Show Data');
            div.hide('100');
        }

    });
});

When I include the jquery UI script file, this code no longer works. The text for the hyperlink changes, but the div is not actually displayed.

Why is this?

Upvotes: 0

Views: 85

Answers (1)

Nick Craver
Nick Craver

Reputation: 630409

I think what you're seeing here is a result of the removal/change of some code in jQuery UI 1.8. Previously, and still in core, any unrecognized string passed to hide/show defaults to the "normal" speed.

For more details, you can see a similar question here: jQuery 1.4.2 - is $("#foo").hide("normal") broken or am I crazy?

Upvotes: 1

Related Questions