Answer the question
In order to leave comments, you need to log in
How to make jquey code apply to all objects with id #modals?
there is this code:
$( "#modals" ).click(function() {
$( ".main" ).css( "-webkit-filter", "blur(5px)" );
$( ".modalDialog" ).css( "background", "rgba(0,0,0,0.8)" );
$( "html" ).css( "overflow", "hidden" );
$( ".main" ).css( "transition", "0.5s" );
});
Answer the question
In order to leave comments, you need to log in
id is unique and should not be repeated. There is a class for this, it is used in the same way, but it can be repeated, and instead of "#" a dot is written - ".". So the code will look like this:
$( ".modals" ).click(function() {
$( ".main" ).css( "-webkit-filter", "blur(5px)" );
$( ".modalDialog" ).css( "background", "rgba(0,0,0,0.8)" );
$( "html" ).css( "overflow", "hidden" );
$( ".main" ).css( "transition", "0.5s" );
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question