Table of contents
Installation and adjustment
Copy files "sprigst-scroller.swf/ sprigst_scroller.js and settings.txt" in the catalogue of your site on a web-server. Create files of scrolled items if they are not created yet. Also edit a configuration file of scroller. Now scroller is established and ready to embedding in a web-page.The scrolled item, as a rule, consists of 2 files: a file of contents (.html) and a file of styles (.css). If some items should have identical registration it is enough to create one file of styles and to use it for different items. You can refuse use of a file of styles and set parameters of registration of an item in a file of contents. You also can use a plain text, jpeg, gif, png or swf file as scrolled items.
Adjustment is carried out by the instruction of parameters in a configuration file. By default the file of adjustments refers to settings.txt. There is an opportunity to set a way to a file of adjustments through a variable settingsFileName.An example:
<script type="text/javascript">
<!--
var scr_INIT_1={
swf:'./sprigst-scroller.swf',
id:'sotester_1',
settings : './settings.txt',
container : 'flashcontent_1',
width:270,
height: 250
}
var scr = new SprigstScroller(scr_INIT_1);
//-->
</script>
In a file of adjustments use of comments is supposed: the one-line comment begins with //, multi-line case begins with /* and comes to an end */.
//It is the one-line comment ... /* It is the multi-line comment */
Parameters of a configuration file
refreshTime
The parameter refreshTime sets an interval of scrolling in milliseconds.For example: let the interval of scrolling is equal 20 milliseconds, it means, that everyone 20 milliseconds content of scroller will move on 1 pixel upwards. It corresponds to speed of updating ~50fps. If the parameter is not set, its value defined by measurement of productivity of a client computer.
background
The section background contains tinctures of a scroller background. It includes the following parameters:- color - sets color of a background
- src - URL to a file used as the background image. Formats are supported: jpeg, gif, png and swf (including animated)
- x,y - set coordinates of the background image in scroller (a position of the top left corner of the image). Cancel action of parameter align.
- align - sets an arrangement of the background image. Values are possible:
- tl - at the upper left
- tc - above on the centre
- tr - at the upper right
- cl - on the centre at the left
- cc - on the centre
- cr - on the centre on the right
- bl - below at the left
- bc - below on the centre
- br - below on the right
...
"background":{
"src":"bground.swf",
"x":"20",
"y":"50",
"align":"tl",
"color":"0xffdfaa"
}
...
In the given example on a background of orange colour (0xffdfaa) the image from a file bground.swf in a position with coordinates x = 20 and y = 50 is placed. The parameter align is ignored since parameters x and y are set.
itemsCommonCfg
The section itemsCommonCfg contains the general for all scrolled items adjustments. Includes parameters:- css - URL to a file of styles
- bgColor - colour of a background of scrolled items
- onRollOverBgColor - colour of a background scrolled items at prompting the cursor of the mouse
- borderColor - colour of a framework of scrolled items
- onRollOverBorderColor - Color of a framework of scrolled items at prompting the cursor of the mouse
...
"itemsCommonCfg":{
"css":"./contents/sample_0.css",
"bgColor":"0xffffff",
"onRollOverBgColor":"0xcfcfcf",
"borderColor":"0xcfcfcf",
"onRollOverBorderColor":"0xffffff"
}
...
The set example sets for all scrolled items parameters of style from a file "./contents/sample_0.css", colour of a background by default - "0xffffff", colour of a background at prompting the cursor of the mouse on an item - "0xcfcfcf", colour of a border by default - "0xcfcfcf", colour of a border at prompting the cursor of the mouse on an item - "0xffffff".
items
The section items contains the list of scrolled items. Each element contains following parameters:- src - URL to a html-file of a contained item of scrolling
- link - transition on URL at click by the
Parameters css, bgColor, onRollOverBgColor, borderColor, onRollOverBorderColor redefine values of corresponding parameters of object articleCommonCfg.
An example:...
"items":[
{
"src":"./contents/sample_0.html",
"bgColor":"0xffccff",
"onRollOverBgColor":"0xccffcc",
"borderColor":"0xff0000",
"onRollOverBorderColor":"0x0000ff"
},
{
"src":"./contents/sample_1.html",
"css":"./contents/sample_1.css",
"borderColor":"0xaaffaa",
"onRollOverBorderColor":"0xaaffff"
},
{
"src":"./contents/sample_2.html"
}
]
...
In the given example for the first item the parameters established in section itemsCommonCfg are redefined all, contents of an item are in a file "./contents/sample_0.html".
For the second item the parameter of a file of styles and parameters of a background is redefined, contents of an item are in a file "./contents/sample_1.html".
The third item - uses values of the parameters established in section itemsCommonCfg, contents of an item are in a file "./contents/sample_2.html".For all items value of parameter link is undefined.
