You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/configuration-web.mdx
+5-87Lines changed: 5 additions & 87 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,8 @@ Simply create a div container where you want alphaTab to be located on your page
13
13
to the available width of the div when using the page layout. If you prefer a fixed layout simply set a fixed width on the div via CSS
14
14
and no resizes to alphaTab will happen either.
15
15
16
-
If jQuery is detected on the page you can use the jQuery plugin to interact with alphaTab. Otherwise alphaTab is initailized using a special `API`
17
-
object. The main namespace `alphaTab` contains every class and enum exposed by the API. The main api is the `alphaTab.AlphaTabApi`
18
-
class:
16
+
The main namespace `alphaTab` and its sub-namespaces like `model` or `midi` contain all types and functionalities by alphaTab. The main api is the `alphaTab.AlphaTabApi`
17
+
class which can be used to initialize and interface with alphaTab:
19
18
20
19
```html
21
20
<divid="alphaTab"></div>
@@ -27,78 +26,20 @@ const api = new alphaTab.AlphaTabApi(element);
27
26
28
27
## Settings
29
28
30
-
There are 2 main ways to initialize alphaTab: either via a settings object or via data attributes.
31
-
Depending on the technologies used in your project either the direct code initialization or the data attributes might be easier to use.
32
-
33
-
The data attributes might be more suitable for server side rendering technologies where settings are provided from a backend infrastructure
34
-
during page rendering. When printing the main alphaTab div element to the DOM you can pass on any settings you might want to have.
35
-
36
-
When using client side frontend frameworks like Angular, React or even plain JavaScript it might be more suitable to initialize alphaTab
37
-
via a settings object.
38
-
39
-
Both systems can be combined while the data attributes will overrule the JSON settings.
40
-
The full list of settings can be found in the [API Reference](/docs/reference/settings).
41
-
42
-
importTabsfrom'@theme/Tabs';
43
-
importTabItemfrom'@theme/TabItem';
44
-
45
-
<Tabs
46
-
defaultValue="js"
47
-
values={[
48
-
{ label: 'Settings Object', value: 'js', },
49
-
{ label: 'jQuery', value: 'jq', },
50
-
{ label: 'Data Attributes', value: 'html', },
51
-
]
52
-
}>
53
-
<TabItemvalue="js">
54
-
55
29
The settings object is passed to the constructor of the API object as second parameter:
56
30
57
31
```js
58
32
constapi=newalphaTab.AlphaTabApi(element, {
59
33
// any settings go here
60
34
});
61
-
```
62
-
63
-
</TabItem>
64
-
<TabItemvalue="jq">
65
35
66
-
AlphaTab is initialized via the `$.alphaTab()` plugin. The first parameter is the settings object and the API object will be returned.
67
-
68
-
```js
69
-
constapi=$('#alphaTab').alphaTab();
70
36
```
71
37
72
-
</TabItem>
73
-
<TabItemvalue="html">
74
-
75
-
Data Attributes will only allow configuration, you still need to manually initailize alphaTab with one of the other variants.
76
-
But the settings parameter can be simply left out.
0 commit comments