Class_effects: Class effects.

Description Usage Arguments Details Examples

Description

Manipulate specified class(es) to matched elements while animating all style changes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
jqui_add_class(
  ui,
  className,
  duration = 400,
  easing = "swing",
  complete = NULL
)

jqui_remove_class(
  ui,
  className,
  duration = 400,
  easing = "swing",
  complete = NULL
)

jqui_switch_class(
  ui,
  removeClassName,
  addClassName,
  duration = 400,
  easing = "swing",
  complete = NULL
)

Arguments

ui

The target ui element(s) to be manipulated. Can be

className

One or more class names (space separated) to be added to or removed from the class attribute of each matched element.

duration

A string or number determining how long the animation will run.

easing

A string indicating which easing function to use for the transition.

complete

A js function to call once the animation is complete, called once per matched element.

removeClassName

One or more class names (space separated) to be removed from the class attribute of each matched element.

addClassName

One or more class names (space separated) to be added to the class attribute of each matched element.

Details

These functions are the R wrappers of addClass(), removeClass() and switchClass() from jQuery UI library. They should be used in server of a shiny app.

Examples

1
2
3
4
5
6
7
8
## Not run: 
  # in shiny ui create a span
  tags$span(id = 'foo', 'class animation demo')

  # in shiny server add class 'lead' to the span
  jqui_add_class('#foo', className = 'lead')

## End(Not run)

shinyjqui documentation built on Feb. 23, 2021, 9:06 a.m.