woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.91k stars 1.69k forks source link

Fix for Number-typed values are deprecated for jQuery.fn.css #1788

Closed JamoCA closed 2 months ago

JamoCA commented 4 years ago

When using FlexSlider 2.7.2 with jQuery 3 + Migrate, there's a "Number-typed values are deprecated for jQuery.fn.css" warning.

Solution: Always pass string values to .css(), and explicitly add units where required. For example, use $.css("line-height", "2") to specify 200% of the current line height or $.css("line-height", "2px") to specify pixels. When the numeric value is in a variable, ensure the value is converted to string, e.g. $.css("line-height", String(height)) and $.css("line-height", height+"px").