简体   繁体   中英

OnSelectStart doesn't work on Firefox

I have this code:

<div id="menu_blue" onSelectStart="show_and_hide()">
  ...
</div>
<div id="menu_red">
  ...
</div>

<script>
function show_and_hide()
{
    $("#menu_red").slideToggle("slow");
}
</script>

and my firefox version 38.0.5 doesn't want to do anything. I know it could be replaced by OnClick="" but I want to know why firefox does't support this function. Does anybody know? Thank you.

Rather than using doing your click event handlers in HTML it is better to bind them on the document ready or load.

$(document).on("ready",function(){
 $("#menuBttn").on("click",function(event){

  })
})

Also you might find this useful, http://help.dottoro.com/ljwdpnva.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM