-
Notifications
You must be signed in to change notification settings - Fork 0
jQuery.fn.removeModifier()
- jQuery.fn.removeModifier(modifier)
- jQuery.fn.removeModifier(modifierName, modifierValue)
- jQuery.fn.removeModifier(modifiers)
Version added: 1.0.0
Removes the modifier(s) from each block or element of the current set of jQuery objects. This method retains chaining.
The current set of jQuery objects.
Type: jQuery object
modifier
One or more modifiers, separated by a space.
Type: String
Removes modifiers defined as a string from a set of blocks:
HTML:
<html>
<body>
<div class="product product_is-selected product_size_xs clearfix"></div>
<div class="product product_is-selected product_size_xs"></div>
</body>
</html>
Code:
$('.product').removeModifier('is-selected size_xs');
Result:
<html>
<body>
<div class="product clearfix"></div>
<div class="product"></div>
</body>
</html>
Removes modifiers defined as a string from a set of elements:
HTML:
<html>
<body>
<div class="product__name product__name_is-selected product__name_size_xs clearfix"></div>
<div class="product__name product__name_is-selected product__name_size_xs"></div>
</body>
</html>
Code:
$('.product__name').removeModifier('is-selected size_xs');
Result:
<html>
<body>
<div class="product__name clearfix"></div>
<div class="product__name"></div>
</body>
</html>
Version added: 1.0.0
Removes the modifier from each block or element of the current set of jQuery objects. This method retains chaining.
The current set of jQuery objects.
Type: jQuery object
modifierName
The name of the modifier.
Type: String
modifierValue
The value of the modifier.
Type: String
Removes the modifier with name and value from a set of blocks:
HTML:
<html>
<body>
<div class="product product_size_xs clearfix"></div>
<div class="product product_size_xs"></div>
</body>
</html>
Code:
$('.product').removeModifier('size', 'xs');
Result:
<html>
<body>
<div class="product clearfix"></div>
<div class="product"></div>
</body>
</html>
Removes the modifier with name and value from a set of elements:
HTML:
<html>
<body>
<div class="product__name product__name_size_xs clearfix"></div>
<div class="product__name product__name_size_xs"></div>
</body>
</html>
Code:
$('.product__name').removeModifier('size', 'xs');
Result:
<html>
<body>
<div class="product__name clearfix"></div>
<div class="product__name"></div>
</body>
</html>
Version added: 1.0.0
Removes the modifier(s) from each block or element of the current set of jQuery objects. This method retains chaining.
The current set of jQuery objects.
Type: jQuery object
modifiers
A list of modifiers.
Type: Array
Removes modifiers defined as a list from a set of blocks:
HTML:
<html>
<body>
<div class="product product_is-selected product_size_xs clearfix"></div>
<div class="product product_is-selected product_size_xs"></div>
</body>
</html>
Code:
$('.product').removeModifier(
[{ name: 'is-selected' }, { name: 'size', value: 'xs' }]
);
Result:
<html>
<body>
<div class="product clearfix"></div>
<div class="product"></div>
</body>
</html>
Removes modifiers defined as a list from a set of elements:
HTML:
<html>
<body>
<div class="product__name product__name_is-selected product__name_size_xs clearfix"></div>
<div class="product__name product__name_is-selected product__name_size_xs"></div>
</body>
</html>
Code:
$('.product__name').removeModifier(
[{ name: 'is-selected' }, { name: 'size', value: 'xs' }]
);
Result:
<html>
<body>
<div class="product__name clearfix"></div>
<div class="product__name"></div>
</body>
</html>
bem.elementSeparator
bem.modifierSeparator
bem.modifierValueSeparator
bem.block()
bem.blockModifier()
bem.element()
bem.elementModifier()
bem.getBlock()
bem.getElement()
jQuery.fn.addModifier()
jQuery.fn.blockName()
jQuery.fn.elementName()
jQuery.fn.getBlock()
jQuery.fn.getElement()
jQuery.fn.hasModifier()
jQuery.fn.isBlock()
jQuery.fn.isElement()
jQuery.fn.modifierValue()
jQuery.fn.removeModifier()