You are not logged in.

a.pu

Trainee

  • "a.pu" started this thread

Posts: 113

Location: Default city, Russia

Occupation: krpano developer with 10 years of experience

  • Send private message

1

Tuesday, August 4th 2020, 6:35pm

Replacing <p></p> tag with div

When textfield sees <p></p> tag it replaces it with <div style="padding-top:2.5px; padding-bottom:5px;"></div>
And it also replaces other tags starting with 'p' like 'path' breaking HTML the layout.

I wonder why is it happening and is there any way to disable this behaviour?

This post has been edited 1 times, last edit by "a.pu" (Sep 23rd 2020, 10:26am)


2

Wednesday, September 23rd 2020, 11:33am

I guess if you want add complex html, then better avoid going through html="data:..."
create your layer and then add your stuff by javascript using layer.sprite
but be aware that kprano has its way to represent its layers/hotspots as html,
so not everything is in your control.

a.pu

Trainee

  • "a.pu" started this thread

Posts: 113

Location: Default city, Russia

Occupation: krpano developer with 10 years of experience

  • Send private message

3

Wednesday, September 23rd 2020, 11:42am

I guess if you want add complex html, then better avoid going through html="data:..."
create your layer and then add your stuff by javascript using layer.sprite
but be aware that kprano has its way to represent its layers/hotspots as html,
so not everything is in your control.


More workarounds, yeah.
Btw works the same if I set html property from external JS

4

Friday, September 25th 2020, 10:45am

Hi,

the <p> to <div> replacement comes from the Flash-times to keep compatible with existing examples and gets the same results.

For using raw-html maybe have a look at this example:
https://krpano.com/examples/#pp-blur

and there at the 'add_html_code' action - it provides a way for adding direct unmodified html to a layer.

Best regards,
Klaus

a.pu

Trainee

  • "a.pu" started this thread

Posts: 113

Location: Default city, Russia

Occupation: krpano developer with 10 years of experience

  • Send private message

5

Friday, September 25th 2020, 11:35am

Hi,

the <p> to <div> replacement comes from the Flash-times to keep compatible with existing examples and gets the same results.

For using raw-html maybe have a look at this example:
https://krpano.com/examples/#pp-blur

and there at the 'add_html_code' action - it provides a way for adding direct unmodified html to a layer.

Best regards,
Klaus


Source code

1
caller.sprite.appendChild(div);


oh
ok