Skip to Content

reflow()

Manually reflow an element.

JavaScript July 2, 2019

Usage

JavaScript
nebula.reflow(selector)

Parameters

selector
(Required) (Object or String) The element to reflow
Default: None

Parameter Notes

Can be passed as a jQuery object or just a selector.

Request or provide clarification »

Examples

Reflow an element so it can be animated via adding a class.

JavaScript
var element = jQuery('#example');
element.removeClass('animate');
nebula.reflow(element);
element.addClass('animate');

Additional Notes

This function is helpful for repeating an animation on the same element.

Source File

Located in /assets/js/nebula.js on line 3883.

JavaScript
nebula.reflow = function(selector){
    if ( typeof selector === 'string' ){
        var element = jQuery(selector);
    } else if ( typeof selector === 'object' ) {
        var element = selector;
    } else {
        return false;
    }

    element.width();
};

Override

To override or disable this JavaScript function, simply redeclare it with the exact same function name.

JavaScript
nebula.reflow = function(selector){
    //Write your own code here, leave it blank, or return false.
}