Documentation
¶
Index ¶
- Constants
- type Class
- func (e *Class) AddToList(name, class string) (ref *Class)
- func (e *Class) DeleteList(name string) (ref *Class)
- func (e *Class) OnLoopEnd(name string) (ref *Class)
- func (e *Class) Remove()
- func (e *Class) RemoveFromList(name, class string) (ref *Class)
- func (e *Class) SetList(name string, classes ...string) (ref *Class)
- func (e *Class) SetOnLoopEndFunc(f func(listName string)) (ref *Class)
- func (e *Class) SetOnToggleFunc(f func(listName string)) (ref *Class)
- func (e *Class) SetRef(id string, refElement *js.Value) (ref *Class)
- func (e Class) String() (list string)
- func (e *Class) Toggle(name string) (ref *Class)
- func (e *Class) ToggleList(list ...string) (ref *Class)
- func (e *Class) ToggleLoop(loop int) (ref *Class)
- func (e *Class) ToggleStart() (ref *Class)
- func (e *Class) ToggleStartInterval(interval time.Duration) (ref *Class)
- func (e *Class) ToggleStop() (ref *Class)
- func (e *Class) ToggleTime(interval time.Duration, list ...string) (ref *Class)
Constants ¶
View Source
const (
KCssListNameNotFound = "html.CssToggle().error: css list name not found:"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Class ¶
type Class struct {
// contains filtered or unexported fields
}
Class
English:
Allows you to easily change the cc of an HTML element
Exemplo:
var class = new(css.Class)
// Create a css list named "red" with value "user red"
class.SetList("red", "user", "red").
// Create a css list named "yellow" with value "user yellow"
SetList("yellow", "user", "yellow").
// Create a css list named "user" with value "user"
SetList("user", "user").
// Defines that the "red" and "yellow" lists will change every second
ToggleTime(time.Second, "red", "yellow").
// Limit trades to 10 interactions
ToggleLoop(10).
// Defines the list named "norm" as the active list at the end of interactions
OnLoopEnd("user").
// Start interactions. Caution: they only work after being added to the element
ToggleStart()
var a html.Div
// Create a div with id "example_A";
a.NewDiv("example_A").
// Sets css to be "name_a name_b name_N";
Css("name_a", "name_b", "name_N").
// Adds the div to the element id "stage".
AppendById("stage")
var b html.Div
// Create a div with id "example_B";
b.NewDiv("example_B").
// Sets css to be "name_a name_b name_N";
Css("name_a", "name_b", "name_N").
// css.Class cannot work properly before being added, due to lack of reference to the parent
// object.
SetCssController(class).
// Adds the div to the element id "stage".
AppendById("stage")
Português:
Permite alterar o cc de um elemento HTML de forma fácil
Exemplo:
var class = new(css.Class)
// Crie uma lista css de nome "red" com o valor "user red"
class.SetList("red", "user", "red").
// Crie uma lista css de nome "yellow" com o valor "user yellow"
SetList("yellow", "user", "yellow").
// Crie uma lista css de nome "user" com o valor "user"
SetList("user", "user").
// Define que as listas "red" e "yellow" vão trocar a cada segundo
ToggleTime(time.Second, "red", "yellow").
// Limita as trocas em 10 interações
ToggleLoop(10).
// Define alista de nome "normal" como sendo a lista ativa ao final das interações
OnLoopEnd("user").
// Inicia as interações. Cuidado: elas só funcionam após serem adicionadas ao elemento
ToggleStart()
var a html.Div
// Cria uma div de id "example_A";
a.NewDiv("example_A").
// Define css como sendo "name_a name_b name_N";
Css("name_a", "name_b", "name_N").
// Adds the div to the element id "stage".
// Adiciona a div ao elemento de id "stage".
AppendById("stage")
var b html.Div
// Cria uma div de id "example_B";
b.NewDiv("example_B").
// Define css como sendo "name_a name_b name_N";
Css("name_a", "name_b", "name_N").
// css.Class não consegue funcionar corretamente antes de ser adicionada, por falta de
// referência do objeto pai.
SetCssController(class).
// Adiciona a div ao elemento de id "stage".
AppendById("stage")
func (*Class) AddToList ¶
AddToList
English:
Add a class name to given list of classes.
Input:
name: name of the class list;
class: name of the class to be added.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Adiciona o nome de uma classe a uma determinada lista de classes.
Entrada:
name: nome da lista de classes;
class: nome da classe a ser adicionada.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) DeleteList ¶
DeleteList
English:
Removes a list of classes.
Input:
name: name of the list of classes to be removed.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Remove uma lista de classes.
Entrada:
name: nome da lista de classes a ser removida.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) OnLoopEnd ¶
OnLoopEnd
English:
Defines the name of the css list to be used at the end of the loop.
Input:
name: css list name.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Define o nome da lista css a ser usada no final do loop.
Entrada:
name: nome da lista css.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) Remove ¶
func (e *Class) Remove()
Remove
English:
This function must be called when the object is removed.
Português:
Esta função deve ser chamada quando o objeto for removido.
func (*Class) RemoveFromList ¶
RemoveFromList
English:
Removes a class name from a given list of classes.
Input:
name: name of the class list;
class: name of the class to be removed.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Remove o nome de uma classe de uma determinada lista de classes.
Entrada:
name: nome da lista de classes;
class: nome da classe a ser removida.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) SetList ¶
SetList
English:
Adds a new list of css classes.
Input:
name: css list name;
classes: css class list.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Adiciona uma nova lista de classes css.
Entrada:
name: nome da lista css;
classes: lista de classes css.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) SetOnLoopEndFunc ¶
SetOnLoopEndFunc
English:
Defines the function to be executed at the end of interactions
Input:
f: function to be executed at the end of interactions.
listName: current list name.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Define a função a ser executada ao fim das interações
Entrada:
f: função a ser executada ao fim das interações.
listName: nome da lista atual.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) SetOnToggleFunc ¶
SetOnToggleFunc
English:
Defines the function to be performed at each iteration.
Input:
f: function to be executed at each iteration.
listName: current list name.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Define a função a ser executada a cada interação.
Entrada:
f: função a ser executada a cada interação.
listName: nome da lista atual.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) SetRef ¶
SetRef
English:
References the parent object.
Input:
id: parent object id.
refElement: object reference.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Referencia o objeto pai.
Entrada:
id: id do objeto pai.
refElement: referência do objeto.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) Toggle ¶
Toggle
English:
Swap the element's css list of classes.
Entrada:
name: name of the list of classes to use.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of:
<... css="name1 name2 nameN">
var element = document.getElementById("myDIV");
element.classList.toggle("myStyle");
Português:
Troca a lista de classes css do elemento.
Entrada:
name: nome da lista de classes a ser usada.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a:
<... css="name1 name2 nameN">
var element = document.getElementById("myDIV");
element.classList.toggle("myStyle");
func (*Class) ToggleList ¶
ToggleList
English:
Defines a new list.
Input:
name: names of the lists to be used in the toggle.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of:
<... css="name1 name2 nameN">
var element = document.getElementById("myDIV");
element.classList.toggle("myStyle");
Português:
Define uma nova lista.
Entrada:
list: nome das listas a serem usadas na trocas.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a:
<... css="name1 name2 nameN">
var element = document.getElementById("myDIV");
element.classList.toggle("myStyle");
func (*Class) ToggleLoop ¶
ToggleLoop
English:
Defines a finite number of interactions.
Input:
loop: number of interactions.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Define um número finito de interações.
Entrada:
loop: número de interações.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) ToggleStart ¶
ToggleStart
English:
Start css class toggle functionality.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Reinicializa a funcionalidade de troca de classes css após usar a função CssToggleStop().
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) ToggleStartInterval ¶
ToggleStartInterval
English:
Start css class toggle functionality.
Entrada:
interval: intervalo de tempo entre as trocas.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Reinicializa a funcionalidade de troca de classes css após usar a função CssToggleStop().
Entrada:
interval: intervalo de tempo entre as trocas.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) ToggleStop ¶
ToggleStop
English:
Breaks the toggle loop between css classes.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of <... css="name1 name2 nameN">
Português:
Interrompe o laço de trocas entre classes css.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a <... css="name1 name2 nameN">
func (*Class) ToggleTime ¶
ToggleTime
English:
Swap the element's css list of classes.
Input:
interval: time interval between toggle;
name: names of the lists to be used in the toggle.
Note:
* This function is equivalent to html.SetList("current", classes...)
* Css has a feature that allows you to easily change the list of css classes of an html tag,
with the functions SetList(), CssToggle() and CssToggleTime();
* Is the equivalent of:
<... css="name1 name2 nameN">
var element = document.getElementById("myDIV");
element.classList.toggle("myStyle");
Português:
Troca a lista de classes css do elemento.
Entrada:
interval: intervalo de tempo entre as trocas;
list: nome das listas a serem usadas na trocas.
Nota:
* Esta função equivale a SetList("current", classes...);
* Css tem uma funcionalidade que permite trocar a lista de classes css de uma tag html de forma
fácil, com as funções SetList(), CssToggle() e CssToggleTime();
* Equivale a:
<... css="name1 name2 nameN">
var element = document.getElementById("myDIV");
element.classList.toggle("myStyle");
Click to show internal directories.
Click to hide internal directories.