Answer the question
In order to leave comments, you need to log in
Why does the event object need to be passed as a function argument in Firefox when using jQuery?
Code example:
$('.block').click(function(){
var is = $(this);
if(!is.hasClass('active')){
is.addClass('active')
event.stopPropagation();
}
});
$('.block').click(function(event){
// тут все работает
})
Answer the question
In order to leave comments, you need to log in
The first piece of code is not correct. The use of an uninitialized variable, or rather the use of the window.event variable, which may not be initialized. Whereas jQuery explicitly states the presence of the event parameter in the click callback , which is where the event object comes in.
So firefox, in this case, protected you from incorrect code. I think using use strict; in any browser would not allow you such liberties.
Place .main-item after .slider.active, change the order with flex and refer to it with a plus sign.
~ also works only on subsequent elements (and + only on the
next one ) UPD https://jsfiddle.net/1whm1g4o/3/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question