1

I am trying to trigger click() function on a button in onNext event.

{
    element: "#action_header",
    title: "Saving to database",
    content: "After you declare the result .. ",                
    placement: "left",
    onNext: function() {
         $('.dropdown-toggle').click();
    }
},
{
    element: "#slideshow",
    title: "Settings",
    content: "Click on the Settings icon... ",
    placement: "left",
    // delay: 200,
    // onShow: function() {
           //     $('.dropdown-toggle').click();
    // }
},

But this will only highlight the button and show the `next step modal` elsewhere instead of specified element.

Here's the html:

<div class="btn-group">
       <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
       <i class="fa fa-cog"></i></button>
       <ul class="dropdown-menu" role="menu">
           <li class="active"><a id="detail_view" href="javascript:;">Detail View</a></li>
           <li><a id="slideshow" href="javascript:;" onclick="adminSlideshowRedirect();">Slideshow</a></li>
       </ul>
</div>

When I trigger $('.dropdown-toggle').click() from the console, the button is being clicked properly.

What am I doing wrong here?

Azima
  • 3,835
  • 15
  • 49
  • 95

1 Answers1

0

The issue is your dropdown is being clicked, but it is toggled again, due to onBlur toggle of your dropdown. You need to remove onBlur toggle and it will work fine.