Ok-Alex
Ok-Alex

Reputation: 558

Qtip on input focus

I want to show Qtip when input get focus. Here is my code:

<script>
    function inputQtip(){
    alert("Test");
    $('#aerobot[title]').qtip({
        position: {
            my: 'right center',
            at: 'left center',
            target: $('.aerobot'),
        },
        show: {
            when: {
                target: $('#aerobot'),
                event: 'focus',
            },
        }
    });
}
inputQtip();
</script>

And its not working. Alert popups. So function is executing. What is wrong with this qtip ? :(

Upvotes: 1

Views: 1199

Answers (1)

Ujjwal Manandhar
Ujjwal Manandhar

Reputation: 2244

there's nothing wrong with this code. you just forgot to wrap it in document.ready function.

$(document).ready(function() {
    inputQtip();
});

Upvotes: 1

Related Questions