Resizing IAT category label

13 views
Skip to first unread message

Benedek Kurdi

unread,
Jun 20, 2022, 12:44:31 PM6/20/22
to Minno.js

Hi all,
I'm trying to use an image as an IAT category label in the following way:
           title : {
                media : {image : global.cs_pos[0]+'.png'}, //Name of the category presented in the task.
                css : {color:'#31b404','font-size':'2em'}, //Style of the category title.
                height : 4 //Used to position the "Or" in the combined block.
            },

Is there a way to resize the image here? I would do it manually for each image, but I'm working on a study that has a huge number of potential stimuli from which I select randomly.
Thanks so much!
—Benedek

Mayan Navon

unread,
Jun 20, 2022, 1:50:49 PM6/20/22
to Benedek Kurdi, Minno.js
Hi Benedek,

This code worked for me when resizing the stimuli, pretty sure it should work for images as labels as well:
  category1 : {
            name :  global.target1_name,
            title : {
                media : {word : global.target1_name}, //Name of the category presented in the task.
                css : {color:'#31b404','font-size':'1.8em'}, //Style of the category title.
                height : 4//25//4//Used to position the "Or" in the combined block.
            }, 
            stimulusMedia : [
                {html: '<img src="' + global.baseURL + global.target1_face + '_1_no.jpg;"' + 'style="height: 170px;">'},
                {html: '<img src="' + global.baseURL + global.target1_face + '_2_no.jpg;"' + 'style="height: 170px;">'},
                {html: '<img src="' + global.baseURL + global.target1_face + '_3_no.jpg;"' + 'style="height: 170px;">'}

            ],            
            stimulusCss : {height:10,color:'#31b404','font-size':'1.8em'}
        },
Best,
Mayan


--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/c0a0e54d-b61b-4bcb-88d1-eef17f9c20f0n%40googlegroups.com.

Benedek Kurdi

unread,
Jun 20, 2022, 2:10:04 PM6/20/22
to Mayan Navon, Minno.js

I tried this but it's not working:
            name : 'CSpos', //Will appear in the data.
            title : {
                html: '<img src="/implicit/user/bkurdi/microec1/images/' + global.cs_pos[0] + '.png;"' + 'style="height: 170px;">',

                css : {color:'#31b404','font-size':'2em'}, //Style of the category title.
                height : 4 //Used to position the "Or" in the combined block.
            }, 

I'm assuming something is off with the brackets?
Thanks again!
—Benedek

Mayan Navon

unread,
Jun 20, 2022, 2:19:51 PM6/20/22
to Benedek Kurdi, Minno.js
I'm not sure your image source knows how to complete the prefix to the full url. Let's try using the full path to the images.


Mayan Navon

unread,
Jun 20, 2022, 2:21:52 PM6/20/22
to Benedek Kurdi, Minno.js
Like this: '<img src="https://app-prod-03.implicit.harvard.edu/implicit/user/bkurdi/microec1/images/' + global.cs_pos[0] + '.png;"' + 'style="height: 170px;">'

Just checked and the resizing worked for me in the category labels as well.

Benedek Kurdi

unread,
Jun 20, 2022, 2:28:54 PM6/20/22
to Mayan Navon, Minno.js

Still getting the same, no error but also no stimulus.
--
Benedek Kurdi
411 Orange Street #4B
New Haven, CT 06511
Screen Shot 2022-06-20 at 2.27.41 PM.png

Mayan Navon

unread,
Jun 20, 2022, 2:31:03 PM6/20/22
to Benedek Kurdi, Minno.js
Could you please share the link to your study & task?


Benedek Kurdi

unread,
Jun 20, 2022, 2:33:10 PM6/20/22
to Mayan Navon, Minno.js

Mayan Navon

unread,
Jun 20, 2022, 2:45:40 PM6/20/22
to Benedek Kurdi, Minno.js
You need to add a bracket + media type: media : { html : ...
So this works: media : {html : '<img src="https://app-prod-03.implicit.harvard.edu/implicit/user/bkurdi/microec1/images/' + global.cs_pos[0] + '.png;"' + 'style="height: 170px;">'},
Here are my edits to your code.
image.png
image.png

Benedek Kurdi

unread,
Jun 20, 2022, 3:08:56 PM6/20/22
to Mayan Navon, Minno.js

Thanks so much, it's working now!
Reply all
Reply to author
Forward
0 new messages