Custome button to launch TypeForm as slider | Community
Skip to main content
Answered

Custome button to launch TypeForm as slider

  • February 15, 2022
  • 3 replies
  • 434 views

I have a designed website with some buttons, which I want to use to lanuch TypeForm as a slider.

The embed code already includes rthe button design, but I want to keep my button.

Is there a URL or something I can allocate to existing buttons so the form opens as a slider?

Or do I need to recreate the design? In that case, how can I create a gradient button in TypeForm embed customizations?

Best answer by mathio-tf

Hello @Adidacta 

have a look at our embed SDK readme file. You can add functionality to open a slider to any of your existing buttons.

Your code should look something like this:

<button id="button">my button with gradient</button>
<script src="//embed.typeform.com/next/embed.js"></script>
<link rel="stylesheet" href="//embed.typeform.com/next/css/slider.css" />
<script>
  const { toggle } = window.tf.createSlider('oWPUHPmF')
  document.querySelector('#button').onclick = toggle
</script>

You can preview this here: https://glitch.com/edit/#!/exciting-aquamarine-surgeon

View original

3 replies

mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • February 15, 2022

Hello @Adidacta 

have a look at our embed SDK readme file. You can add functionality to open a slider to any of your existing buttons.

Your code should look something like this:

<button id="button">my button with gradient</button>
<script src="//embed.typeform.com/next/embed.js"></script>
<link rel="stylesheet" href="//embed.typeform.com/next/css/slider.css" />
<script>
  const { toggle } = window.tf.createSlider('oWPUHPmF')
  document.querySelector('#button').onclick = toggle
</script>

You can preview this here: https://glitch.com/edit/#!/exciting-aquamarine-surgeon


  • Author
  • Explorer
  • 2 replies
  • February 17, 2022

Thank you very much.
I’ll have a look

Adi


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14923 replies
  • February 24, 2022

Hi @Adidacta Did this work for you? Let us know how it went!


Reply