su_shortcode_animate

The shortcodes-ultimate su shortcode animate function.

Published Date - February 15, 2021

Description

su_shortcode_animate( $atts, $content );

Parameters

  1. $atts

  2. $content


Usage

The following example is for adding a hook callback.

if ( !function_exists( 'su_shortcode_animate' ) ) {
    require_once ABSPATH . PLUGINDIR . 'shortcodes-ultimateshortcodes-ultimate/includes/shortcodes/animate.php';
}

// The input(s). 
$atts = null;
$content = null;

// NOTICE! Understand what this does before running.
$result = su_shortcode_animate( $atts, $content );
            

Defined

The function is defined in the following location(s).

shortcodes-ultimate/includes/shortcodes/animate.php

function su_shortcode_animate( $atts = null, $content = null ) {
	$atts = shortcode_atts( array(
			'type'      => 'bounceIn',
			'duration'  => 1,
			'delay'     => 0,
			'inline'    => 'no',
			'class'     => ''
		), $atts, 'animate' );
	$tag = ( $atts['inline'] === 'yes' ) ? 'span' : 'div';
	$time = '-webkit-animation-duration:' . $atts['duration'] . 's;-webkit-animation-delay:' . $atts['delay'] . 's;animation-duration:' . $atts['duration'] . 's;animation-delay:' . $atts['delay'] . 's;';
	$return = '<' . $tag . ' class="su-animate' . su_get_css_class( $atts ) . '" style="visibility:hidden;' . $time . '" data-animation="' . $atts['type'] . '" data-duration="' . $atts['duration'] . '" data-delay="' . $atts['delay'] . '">' . do_shortcode( $content ) . '</' . $tag . '>';
	su_query_asset( 'css', 'animate' );
	su_query_asset( 'js', 'jquery' );
	su_query_asset( 'js', 'jquery-inview' );
	su_query_asset( 'js', 'su-shortcodes' );
	return $return;
}