Answer the question
In order to leave comments, you need to log in
How to shorten such a jquery entry?
There is this code:
$('#wpu1').hover(function(){$('#epu1').toggle();});
$('#wpu2').hover(function(){$('#epu2').toggle();});
$('#wpu3').hover(function(){$('#epu3').toggle();});
$('#wpu4').hover(function(){$('#epu4').toggle();});
$('#wpu5').hover(function(){$('#epu5').toggle();});
Answer the question
In order to leave comments, you need to log in
for (var i = 1; i < 6; i++) {
$('#wpu'+i).hover(function(){$('#epu'+i).toggle();});
}
I would generally suggest doing this on css3. With the translate property. If you are interested, then write, I will help)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question