Jump to content

Collapsible Menu Help


K Rojas

Recommended Posts

Hello,

I am attempting to implement a collapsible menu (spotfire 7.8). I'm pretty green at javascript, and while I've muddled through other implementations, but I cannot get the one featured here to work.https://spotfired.blogspot.com/2017/12/slide-menu.html. Turining off HTML sanitation is not possible.

I would appreciate some feedback or hints as to how to get this to work.

Thank you.

Link to comment
Share on other sites

Attached is a version that will work with HTML sanitation turned on. Was done in Spotfire X though, so not sure if you can open it.

 

The tricks to get around HTML sanitation

1. whenever you see something like

 

just use your browser to go to the link, copy the code, and then enter it in a JS box inside spotfire

2. whenever you see a tag, thats CSS. Again you have to enter that in a JS box in spotfire, but you have to wrap the JS with

var css = `

at the beginning and

`;

// Add css to the holder div

$("").text(css).appendTo($("#sidedrawerDiv"));

 

at the end. Then in your HTML call it out with a

 

 

There's a wiki with more info on CSS with HTML sanitation turned on here

 

https://community.spotfire.com/wiki/using-css-html-sanitation-turned-google-api-fonts

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...