Created
September 18, 2021 07:57
-
-
Save uzielweb/9ed81db98d11b287a29a9db5025b153c to your computer and use it in GitHub Desktop.
Change span to col-md- classes in Helix Ultimate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add class row to sp-column when children has any part of class with span in the classname | |
jQuery(document).ready(function ($) { | |
$('.sp-column').each(function () { | |
// get the children class names with span in the classname | |
var childrenClasses = $(this).children().map(function () { return this.className; }).get().join(' '); | |
// if children has any part of class with span in the classname | |
if (childrenClasses.indexOf('span') > -1) { $(this).addClass('row'); } | |
// change parte of classname with span to col-md- | |
$(this).children().each(function () { | |
var className = $(this).attr('class'); | |
className = className.replace(/span/g, 'col-md-'); | |
$(this).attr('class', className); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment