Sie sind nicht angemeldet.

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

1

Dienstag, 2. Juni 2009, 19:59

width="100%" offset

Hi,

I have this picture I want in the left, Its 100px wide. The rest I want to fill with a white border, so I made a 1x1 pixel and stretch it to make it fit. My question is, is it somehow possible to do like width="100% - 100" or something like that? So the border is always as wide as krpano but leaves 100px for the image so they don't overlap. If not, could you implement such thing?

Ow I forgot, they have an alpha, so they can't overlap.

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

2

Mittwoch, 3. Juni 2009, 05:27

I don't think you can do it directly as you would like.

If you are using a 1x1 px to make the border... you could set the 1x1 px img to 100% with an x or ox of 100 to move it over to allow for your image. The 1x1px image would still be as wide as the entire stage... but the right side would be pushed out of view of the stage.

You might be able to utilze some javascript to find out how wide the stage is... and then subtract 100 from that... and then use that new value to set the border dimens.

That's a MIGHT.

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

3

Sonntag, 7. Juni 2009, 00:40

Yeah but I thought there was a onresize event in krpano that returns stagewidth and such. Then I could store that in a variable and remove 10px from it. Only I can't figure out the syntax

4

Montag, 8. Juni 2009, 13:41

Yeah but I thought there was a onresize event in krpano that returns stagewidth and such. Then I could store that in a variable and remove 10px from it. Only I can't figure out the syntax

Hi, this would be the solution:

Quellcode

1
<events onresize="sub(plugin[image].width,stagewidth,100);" />

that means:
plugin[image].width = stagewidth - 100

and to call the resize event also on beginning:

Quellcode

1
<events onxmlcomplete="events.onresize();" />


best regards,
Klaus

5

Dienstag, 20. Oktober 2009, 17:20

Hi Klaus,

Is it possible to substract a % of the stagewidth. For example:

<events onresize="sub(plugin[image].width,stagewidth,50%);" />

which means:
plugin[image].width = stagewidth - 50% (of the stagewidth) ?

Or maybe set a percentage of the stagewidth?

Is this possible? Best regards,

D-Tang

6

Mittwoch, 21. Oktober 2009, 10:45

got it working...

7

Mittwoch, 21. Oktober 2009, 10:47

Hi,
Is it possible to substract a % of the stagewidth. For example:

<events onresize="sub(plugin[image].width,stagewidth,50%);" />

which means:
plugin[image].width = stagewidth - 50% (of the stagewidth) ?

Or maybe set a percentage of the stagewidth?
yes,

e.g.

Quellcode

1
2
mul(halfstagewidth, stagewidth, 0.5);
sub(plugin[image].width, stagewidth, halfstagewidth);
that means:
halfstagewidth = stagewidth * 0.5
plugin[image].width = stagewidth - halfstagewidth

or in the case of always 50% just:

Quellcode

1
mul(plugin[image].width, stagewidth, 0.5);


best regards,
Klaus

Ähnliche Themen