jeudi 2 juin 2016

How to test jquery .slideDown() and slideUp() by code?

I use the jQuery to hide and show a div.

function bindIconClick() {
    $('span.scroIcon').click(function(event) {
        var eventIcon = $(event.target);
        var contentPanel = eventIcon.parents('.panelTitle').next();
        if (contentPanel.is(':hidden')) {
            contentPanel.slideDown('slow');
        } else {
            contentPanel.slideUp('slow');
        }
    });
}

I want to test the function, I can use the trigger() to simulate the click event, but I don't know how to test the slideDown() and slideUp() effect.

Aucun commentaire:

Enregistrer un commentaire