2017-10-27 31 views
-1

オンラインでjQueryクイズをダウンロードしましたが、編集はできましたが、画像には質問は含まれていませんでした。 answersオプションはイメージを必要としません。jQueryクイズ内に画像を挿入

個別のファイルである質問のJavaScriptファイルにインラインで追加できると思っていましたが、明らかに機能しませんでした。

質問にどのようにイメージを含めることができますか?

おかげ

/*-------------------------------------- 
Questions JS 
------------------------------*/ 

$("#quiz1").dlxQuiz({ 
    quizData: { 
     "questions": [{ 
      "q": "When following a large vehicle you should keep well back because this (mark ONE answer)", 
      "a": "Allows the driver to see you in the mirrors", 

      "options": [ 
       "Allows you to corner more quickly", 
       "Helps the large vehicle to stop more easily", 
       "Allows the driver to see you in the mirrors", 
       "Helps you to keep out of the wind" 
      ] 



     }, 

{ "images": ["../images/image1.png"], 
      "q": "You are waiting to come out of a side road. Why should you watch carefully for motorcycles? (Mark one answer.)", 
      "a": "Motorcycles are small and hard to see", 
      "options": [ 
       "Motorcycles are usually faster than cars", 
       "Police patrols often use motorcycles", 
       "Motorcycles are small and hard to see", 
       "Motorcycles have right of way" 
      ] 
     }, ] 
    } 
}); 
+2

あなたはそれを絞り込むことができますか? jsの大きな塊ではなく、問題の小さなコードサンプルのように? –

+0

私はちょうどしました。これはあなたのために働きますか?ありがとうございます – UnlimitedA

+0

私はこの巨大なコードダンプを読んで自分自身を悩ますだろうと思っています。 –

答えて

0

私はそれを整理しています。ソリューションは実際にはとても簡単です。私はちょうど質問の冒頭に画像タグを追加する必要があった。すなわち

"q": "<img src=\"img1.png\"/><br>When following a large vehicle you should keep well back because this (mark ONE answer)",