====== Click to Show Information ====== Sometimes it is helpful if the participant can fade in additional information((a short text like this one)) if needed. Depanding on the application there are differnt solutions: - Individual words are most easily explained with a tooltip (see below) - When it comes to displaying text passages on a mouse click, use the [[:en:create:accordion|accordion function]] - If you want to make an extensive text available as additional information, you can open it using ''[[:en:create:functions:textlink|textlink()]]'' in a separate popup window. In addition, you can use [[:en:create:javascript|JavaScript]] to display text, information, items or entire questions at the respondent's click. You can also save if the information got clicked. ===== Hover-Over Tooltip I ===== SoSci Survey recognizes double brackets as an indicator of additional information. Either the mouseover activates a term in the text, or an info icon will be displayed. Double brackets are used as follows: ((Title|Explanation)) If an asterix (''*'') is entered as the title, an info icon will be displayed. In the following examples, the mouseover activates the words "explanation required", and an info icon is displayed after the sentence. This is an ((explanation required|By "explanation required" we mean the content is unable to be understood straightaway.)) item. This is an item that requires an explanation. ((*|By "explanation required" we mean the content is unable to be understood straightaway.)) The info icon and the format of the information can be customized in the Questionnaire Layout using CSS statements in the HTML layout. In order to do this, the CSS statements in the field //Tooltip// are overwritten from the questionnaire stylesheet. ===== Hover-Over Tooltip II ===== Another solution is to use the HTML attribute //title// for additional information. In doing so, a brief piece of information is displayed if the participant lingers on a word with the mouse -- however, not until after a short delay. The word itself can visually highlighted using the ''style'' attribute.

Here is the text with a explanation required Wort.

If the information should not appear directly in an item, just use the '''' tag in the item text directly in the appropriate place. When the sun is shining I would rather go than take part in an online survey. **Note:** The participant's browser is responsible for displaying the ''title'' information. You do not have any influence over how quickly the information is displayed or how it is formatted. ===== Click for Information ===== Web content (so the content of a questionnaire page as well) can be changed dynamically by using JavaScript. Displaying and hiding content entails very simple changes. Information is integrated regularly, but remains invisible at first. You need [[:en:glossary#javascript|JavaScript]] if are using the following solution -- Although implementation is a little bit more demanding, you then get full control as to how and when the information is displayed. ==== Implementation ==== Save the following HTML code as a text element and drag this into the questionnaire page. You have to enter the actual information yourself. Formatting with HTML is possible. **Note:** The following code is only suitable for displaying one info button per questionnaire page. See below for the code for multiple buttons.
Additional info comes here

==== Place Button Freely ==== The display button (at the end of the code in the example above) can also be positioned anywhere in the questionnaire (e.g. directly in the question title). An image can also be used instead of text. First of all, the image has to be uploaded into the survey project. ==== Hover over a Word Instead of Pressing a Button ==== By slightly modifying this you can get rid of having to click, and therefore the info box will be displayed when the user moves over a word: If you need an explanation, move the mouse over the selected word.
Additional information can be seen here
The JavaScript code is the same as above and has to be attached to the HTML code or positioned anywhere on the page. ==== Save Use ==== You can also save whether the information was displayed in the data record. You need an [[:en:create:questions:internal|internal variable]] to be able to do this. Drag the question with the internal variable onto the page above the info text element. var info = document.getElementById("infoBox"); var intVar = document.getElementById("AB01_01"); // the internal variable ID has to be entered here info.style.display = "none"; // Hide box intVar.value = "1"; function buttonShow() { // Display info box info.style.display = ""; // Save that the button was clicked on intVar.value = "2"; } function buttonHide() { // Hide info box again info.style.display = "none"; } ===== More Information on One Page ===== The code examples above are only able to display one piece of information per page. If you want to put multiple info buttons on a page, use the following code. Save the first code as a text element. Insert this text element __once__ (anywhere __before__ the other JavaScript code) into the questionnaire page. Repeat the second code for each button including the info box. You only have to adjust the HTML IDs (''id'') for the button and info box. For example, ''infoButton2'', ''infoBox2'' and ''infoClose2''.
Additional info come here

Place the third code at the end of the questionnaire page. You only have to repeat the last line here for each info box and use the corresponding IDs. ==== Enlarge an Image ==== Using an image as button, and a larger version of the image as "information", you may create a zoom feature. Simply give the images some HTML ID and take care of the larger version's placement.
There is no distinct close button in the example, above -- the larger version itself may be clicked to close the zoom. ==== Save Info Use ==== If you want to save whether a info button was clicked on, internal variables are needed to begin with. Create a new question with the type [[:en:create:questions:internal|internal variables]] in the List of Questions. Add as many variables (items) in this question as info boxes you want to monitor. Drag this question onto the questionnaire page __before__ the JavaScript code. Modify the third code (see above) by additionally specifying the IDs for the internal variables in which the use will be saved. For example: The variables then save how often (starting with 0) the info box was opened. ==== Open on Hover ==== To display a more extensive info box -- immediately, instead of after a short amount of time -- modify the code above. To ensure the information is displayed when it is hovered over, rather than by clicking on it, change the following lines at the end of the first code: // Enable button (open/close by clicking) SoSciTools.attachEvent(button, "click", clickButton); SoSciTools.attachEvent(close, "click", clickClose); // Enable button (open/close with a mouseover) SoSciTools.attachEvent(button, "mouseover", clickButton); SoSciTools.attachEvent(button, "mouseout", clickClose); Remove the close button in the second code. In the following example, text is used to display the info box instead of a button: More Info
Additional info comes here
Enter the HTML ID for the button or the text in the third code: