<button id="bar">bar</button> <div id="foo"></div>
#foo { width: 100px; height: 100px; background-color: green; display:none; }
$('#bar').click(function () { $('#foo').slideToggle('slow'); });
mouseover
$('#bar').mouseover(function () { $('#foo').slideToggle('slow'); });
if (window.matchMedia("(max-width: 767px)").matches) { $('#bar').click(function () { $('#foo').slideToggle('slow'); }); } else { $('#bar').hover(function () { $('#foo').slideToggle('slow'); }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)