MCPcopy
hub / github.com/MrNothing/AI-Blocks / parseClip

Function parseClip

Sources/src/libs/jquery-ui.js:2835–2847  ·  view source on GitHub ↗
( str, element )

Source from the content-addressed store, hash-verified

2833} );
2834
2835function parseClip( str, element ) {
2836 var outerWidth = element.outerWidth(),
2837 outerHeight = element.outerHeight(),
2838 clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
2839 values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
2840
2841 return {
2842 top: parseFloat( values[ 1 ] ) || 0,
2843 right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
2844 bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
2845 left: parseFloat( values[ 4 ] ) || 0
2846 };
2847}
2848
2849$.fx.step.clip = function( fx ) {
2850 if ( !fx.clipInit ) {

Callers 1

jquery-ui.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected