You are not logged in.

1

Tuesday, May 19th 2015, 2:19pm

problems in my tour

Hello friends , I have two problems , please help me .

1 - How do I select all my hostport the same time? for example I want to set the size of all hostport my tour with a unique code .

2 - if(device === mobile , set(hotspot[spot1].width,100) );
if(device === mobile , set(hotspot[spot1].height,100) );

Why this code is not catching ? I've tried so .

if(devices === mobile , set(hotspot[spot1].width,100) );
if(devices === mobile , set(hotspot[spot1].height,100) );

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

2

Tuesday, May 19th 2015, 3:16pm

1) Make a loop

Source code

1
2
3
4
5
6
for( set(counter, 0), counter LT hotspot.count, inc(counter),
    if(device.mobile,
	set(hotspot[get(counter)].width,100);
	set(hotspot[get(counter)].height,100);
  );
);



2)

Source code

1
if(device.mobile, ...

3

Tuesday, May 19th 2015, 3:40pm

Tried So , is something wrong? pq not get caught.

Source code

1
2
3
4
5
6
7
		 if(device.desktop , 

 set(counter, 0), counter LT hotspot.count, inc(counter),
    if(device.mobile,
	set(hotspot[get(counter)].width,200);
	set(hotspot[get(counter)].height,200);
  );

4

Tuesday, May 19th 2015, 4:40pm

Hi,

when you have a - if(device.deskop, ... - around the whole code, then this will be never executed on mobiles ;-).

Btw - there might be also a simpler solution - set the mobile size statically in the xml using the device checks for attributes - e.g.

Source code

1
2
3
4
5
<hotspot ...
         width.normal="200"
         width.mobile="100"
         ...
         />

Note - the 'normal' device is new to the 1.19 version and the same like 'desktop or tablet'. For older versions use 'no-mobile' instead.

Best regards,
Klaus

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

5

Wednesday, May 20th 2015, 10:18am

Little correction : "normal = desktop or tablet"

6

Wednesday, May 20th 2015, 10:58am

Of course! ;-)
Thanks, is corrected now.