Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Check if image has been enlarged

  • Andrea01
  • Andrea01's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 1 week ago #120685 by Andrea01
Check if image has been enlarged was created by Andrea01
High,

I have a Long free text question which Shows an Image, on clicking the Image it gets enlarged.



Here is the code:

<script language="javascript">
<!--
var AngezeigteBreite = 50;
var GespeicherteBreite = 0;

function BildAnpassen(Bild)
{
if (Bild.width > AngezeigteBreite || GespeicherteBreite > AngezeigteBreite)
{
if (Bild.width == AngezeigteBreite)
{
Bild.width = GespeicherteBreite;

}
else
{
GespeicherteBreite = Bild.width;
Bild.style.cursor = "pointer";
Bild.width = AngezeigteBreite;


}
}


}
//--></script>




Want I want is that the Images Needs to be enlarged before answering the question.
Can anyone be of help please?

Thanks and regards

Andrea
The topic has been locked.
More
10 years 1 week ago #120716 by jelo
Replied by jelo on topic Check if image has been enlarged
You missed this part.
Code:
<img onClick="BildAnpassen(this)" onLoad="BildAnpassen(this)" src="/bild.png" title="Klicken zum Vergrößern/Verkleinern">

First I would like to ask the others on this board if there isn't a better zoom/lightbox image script (e.g. jquery plugin), which is suited to surveys? What about dimsemenov.com/plugins/magnific-popup/ ?
Problem is finding an maintained plugin.

Not sure if a 100% errorprone solution is possible, but you might add a hidden question and force an answer. When the image is clicked a certain value is written into that hidden question.
As long as the hidden question is not answered the image has to be clicked.

Since I am not the biggest javascript fan I cannot provide you a readymade solution.
Perhaps my silly lines will provoke a more sophisticated answer from the household user names of this board.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: Andrea01
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose