+ 1

Can I somehow shorten the code on lines 7-10 (html page)?

https://code.sololearn.com/WpxRvzxU2RK5/?ref=app

18th Feb 2018, 1:30 AM
W G
W G - avatar
2 Réponses
+ 4
var anum = $('nav > div'); $.each([1700, 2300, 2900], function(index, value) { anum.eq(index).delay(value).slideDown(550); }); OR $.each({1700:$('nav > div').eq(0), 2300:$('nav > div').eq(1), 2900:$('nav > div').eq(2)}, function(value, element) { element.delay(value).slideDown(550); }); and you can do this: $('div').click(function(){ $('.divOps').fadeIn(400).delay(1200).fadeOut(200); }); BTW, you can put the entire jQuery function in the JS tab and remove the script tag. And I think you mean Oops, not Ops.
18th Feb 2018, 3:18 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
thank you so much! :)
18th Feb 2018, 7:06 AM
W G
W G - avatar