2013-12-12 4 views
1

는 여기에 내가 어떻게 데이터 소개 태그 내에서이 오디오 재생 버튼을 넣어 싶어는 Intro.js 사용 - 데이터 소개를 나는 현재 내 웹 사이트에 대한 Intro.js을 이용하고 있고 코드가 작동

<h2 data-step="1" data-intro="Welcome message!">Welcome back</h2> 

입니다 나는 그것을합니까?

<a onclick="this.firstChild.play()" ><audio src="Audio/WelcomeBack.wav"></audio>▸ </a> 

나는

<h2 data-step="1" data-intro="Welcome message! <a onclick="this.firstChild.play()" ><audio src="Audio/WelcomeBack.wav"></audio>▸ </a>">Welcome back</h2> 

같은 것들을 시도했습니다하지만 태그를 읽지 않습니다. 죄송합니다

, 나는 여전히 초보자이고 여기에 도움이 :이 일을하기 위해

답변

1

, 당신은 JSON을 사용하여 프로그램 정의를 사용해야 할 필요가있다. 예를 들어

:

var intro = introJs(); 
     intro.setOptions({ 
     steps: [ 
      { 
      element: '#step1', 
      intro: "This is a <b>bold</b> tooltip." 
      }, 
      { 
      element: '#step2', 
      intro: "Ok, <i>wasn't</i> that fun?", 
      position: 'right' 
      }, 
      { 
      element: '#step3', 
      intro: 'More features, more <span style="color: red;">f</span><span style="color: green;">u</span><span style="color: blue;">n</span>.', 
      position: 'left' 
      }, 
      { 
      element: '#step4', 
      intro: "<span style='font-family: Tahoma'>Another step with new font!</span>", 
      position: 'bottom' 
      }, 
      { 
      element: '#step5', 
      intro: '<strong>Get</strong> it, <strong>use</strong> it.' 
      } 
     ] 
     }); 

     intro.start(); 

자세한 내용은이 예제를 참조하십시오 : http://usablica.github.io/intro.js/example/html-tooltip/index.html

+0

너무 감사합니다! – Raynoro