Can I do this with less writing?
- $(document).ready(function() {
- $("#d1").hide();
- $("#d2").hide();
- $("#i1").mouseenter(function() {
- $("#d1").show(100);
- });
- $("#i1").mouseleave(function() {
- $("#d1").hide(100);
- });
- $("#i2").mouseenter(function() {
- $("#d2").show(100);
- });
- $("#i2").mouseleave(function() {
- $("#d2").hide(100);
- });
- });
This is my code. I've got a lot more of these d's and i's and I want to make the same thing with them all. Is there a way to not repeat this code over and over again and only changing 2 id's?