Use the event to remove the problems encountered in the shadow in the bootstrap drop-down box?

the default drop-down box of bootstrap has this shadow

clipboard.png

I use the JavaScript event to cancel the drop-down menu and click Inner Shadow

  $(".dropdown").on("show.bs.dropdown", function () {
    $(".dropdown-toggle").css("boxShadow","none")
  });
  

but the strange event encountered is that there is still an inner shadow on the first click after the page is refreshed, but there is no such shadow on the button after the second click. What is this situation?

is there a boss who knows the cause of this problem, or is there a better way to cancel the inner shadow of this button? Thank you

Sep.22,2021

put your js
$(".dropdown-toggle"). Css ('boxShadow','none') in the initialization execution
Don't put it in the dropped event

clipboard.png


@ clipboard.png

my writing like this still doesn't solve that weird problem. Awkward


. Why should the style be changed in the event? Can't you just overlay a high-weight style or change the default style in css?

Menu