Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Dynamically add items from cookie
LIG
Newbie

Posts: 1
Registered: 7/12/2006
Member Is Offline
posted on 7/12/2006 at 05:34 AM Reply With Quote
Dynamically add items from cookie


Hi, Ia??m trying to dynamically create an item array from information in a cookie.
I think that may code is correct but when I rum the web page the scroller doesna??t work.

The cookie string looks like this

num=3;tit1=title 1;tit2=title2;tit3=title3

I put the following code in the scroll.html file:

Instead of items = ITEMS

var num = GetCookie("num"); //geta??s the value of num
var numTitulos = parseInt(num);
var i = 0;
var items = [];
while(i < num)
{
var tit = "tit"+(i+1);
var t = GetCookie(tit); // getta??s the value of the item in the cookie
items = {
'file': '',
'content' : t,
'pause_b': 1,
'pause_a': 0
};
i++;
}

GetCookie is a function that returns the value of the cookie passing the name of the cookie as an argument.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 7/12/2006 at 11:06 AM Reply With Quote

Scroll items structure is the array [] of indexes {}.
I see you created empty array
Code:
var items = [];


and then rewrite it with index multiple times in the loop

Code:
items = {
'file': '',
'content' : t,
'pause_b': 1,
'pause_a': 0
}


Without analyzing cookie parsing stuff (there may be problems there too) this should look something like:

Code:
items = {
'file': '',
'content' : t,
'pause_b': 1,
'pause_a': 0
};


then you feed items to the scroller's constructor
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Scroller
Product Demonstrations Live Demos:
Multiple vertical scrolling
Horizontal scrolling
Free Download Free Download
Product Documentation Documentation:
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
   
Tigra Scroller PRO
Product Demonstrations Live Demos
Vertical automatic scrolling
Horizontal manual scrolling
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004