Sie sind nicht angemeldet.

1

Mittwoch, 6. Mai 2020, 09:49

Specify screen percentage for popup windows instead of pixels - how?

Hi guys
I've tried various ways to adjust the width and height of the popup windows, but seems the only input it accepts is pixel resolution. I'dd like to add screen percentage instead. How can I do that?

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Mittwoch, 6. Mai 2020, 10:20

You can use percentage values, like height="80%" width="80%"

https://krpano.com/docu/xml/#layer.width

...This can be an absolute pixel value or a relative (to the screenwidth or screenheight) percent value. When not set - the size of the loaded image will be used.

...

regards
Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Mittwoch, 6. Mai 2020, 12:41

Yeah the problem is I dont know where to put it
For an image popup for example:

Quellcode

1
onclick="popup('image', 'boards/board_01.jpg', 20, 20, true);"

or

Quellcode

1
onclick="popup('image', 'boards/board_01.jpg', 20%, 20%, true);"

makes no difference, it still opens as much as the image resolution is


On the other hand, on a html popup the res works in pixels:

Quellcode

1
onclick="popup('html', get(data[vimeo_01].content), 800, 450, true);"

but in percentage it doesnt work

Quellcode

1
onclick="popup('html', get(data[vimeo_01].content), 70%, 70%, true);"

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

4

Mittwoch, 6. Mai 2020, 14:54

Give me the full popup() action code and the all layer and styles for her *smile*

Piotr




Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

5

Mittwoch, 6. Mai 2020, 15:16

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
	<action name="popup" scope="private:POPUP" args="type, content, width, height, scrollbars"><![CDATA[
		if(popup, break(); );
		addlayer('popup', popup);
		set(popup,
			type=container,
			width=calc(min(width,global.stagewidth*0.9)),
			height=calc(min(height,global.stageheight*0.8)),
			align=center,
			bgborder='1 0x555555 1',
			bgcolor=0x555555,
			bgalpha=0.7,
			bgshadow='0 10 20 0x000000 0.5',
			bgcapture=true,
			maskchildren=true,
			capture=true,
			handcursor=false,
			alpha=0
		);

		if(type == 'html',
			copy(popup.datacontent, content);
			calc(popup.onloaded, 'add_html_code(get(datacontent),'+scrollbars+');');

		  ,type == 'iframe',
			calc(popup.datacontent, '<iframe style="position:absolute;width:100%;height:100%;top:0px;left:0px;" src="'+content+'" frameborder="0" allowfullscreen></iframe>');
			calc(popup.onloaded, 'add_html_code(get(datacontent),'+scrollbars+');');

		  ,type == 'image',
		 	set(popup,
		 		bgcolor=0xFFFFFF,
		 		bgalpha=1,
		 	);
			addlayer("popup_image", img);
			set(img,
				url=get(content),
				align=center,
				width=-20, height=-20,
				parent=get(popup.name),
				onloaded='popup_imageloaded()'
			);
		);

		tween(global.plugin[pp_blur].range, 40.0);
		delayedcall(0.2, tween(global.layer[popup].alpha, 1.0); );

		set(global.events[popup].onclick,
			set(global.events[popup].name, null);
			tween(global.plugin[pp_blur].range, 0.0);
			tween(global.layer[popup].alpha, 0.0, 0.25, default,
				removelayer('popup', true);
				scope(private:POPUP, delete(popup); );
			);
		);
	]]></action>

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

6

Mittwoch, 6. Mai 2020, 16:02

The easiest way to do it is:

width=calc(min(width,global.stagewidth*0.9)),
height=calc(min(height,global.stageheight*0.8)),

change to

width=80%,
height=80%,

or

Quellcode

1
onclick="popup('html', get(data[vimeo_01].content), 70%, 70%, true);"


Quellcode

1
2
3
4
...
width=get(width),  or width=%3, 
height=get(height), or height=%4,
...
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*