1

I have a html link in which a modal window will be opened while clicking manually. Am using nyromodal, i want the modal window function to get triggered when the shortcut of ctrl+Q is pressed. the shortcut works well when we give just an alert. but not opening the modal.

I tried to trigger the modal function by defining the modal function in the shortcut. But no use. It will be fine if i can click the link dynamically using a jquery function. hopefully that might work. :( no ideas though. Any ideas and help thoughts are welcomed

shortcut.add("Ctrl+Q",function() {
$('.nyroModal').nyroModal();
});

The usual modal function is

$(function() {   $('.nyroModal').nyroModal(); });

It works fine when the link with class nyroModal is clicked but not with the shortcut

html

<a href="new_creation.php" class="nyroModal">Componenets</a>

3 Answers 3

3

What about this:

$(function(){
    $('.nyroModal').nyroModal();

    shortcut.add("Ctrl+Q",function() {
        $('a.nyroModal').click();
    });        
});
Sign up to request clarification or add additional context in comments.

Comments

3

How about:

shortcut.add("Ctrl+Q",function() {
   $('.nyroModal').click();
});

Comments

0

You might want to look into this function which will handle shortcuts.

Linkereeno

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.