UNPKG

jquery.actual

Version:

Older version of jQuery has trouble finding the width/height of invisible DOM elements. With element or its parent element has css property 'display' set to 'none'. `$('.hidden').width();` will return 0 instead of the actual width; This plugin simply fix

12 lines (9 loc) 403 B
'use strict'; Tinytest.add('Actual integration', function (test) { var outerElement = document.createElement('div'); outerElement.value = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in."; outerElement.className = 'hidden'; outerElement.setAttribute('width', '150px'); var actual = $('.hidden').actual('width'); test.isNull(actual, 'instantiation OK'); });