Upper left layout text Demo Experiment Run Experiment

Upper left layout text

Jaap Murre

Advanced layout of text is tricky. You have to get the node that goes with the block and then access the part where the actual text is located. Then, you must grab the 'style' object. This is shown in this demo. Once you have this, you can style the object using standard CSS styles. See for example here: https://www.w3schools.com/jsref/dom_obj_style.asp for an overview. Or Google it, ask ChatGTP etc.

If you are a registered user and signed in, you can here copy this script and its stimuli to your own account, where you can edit it and change it in any way you want.

It is absolutely free to register (no credit card info asked!). You can then instantly copy this experiment with one click and edit it, change its accompanying texts, its landing page, stimuli, etc. Invite your colleagues, friends, or students to check out your experiment. There is no limit on how many people can do your experiment, even with a free account.

The catch? There is no catch! Just keep in mind that with a free account, you cannot collect data. For teaching that is usually not a problem. For research, prepaid data collection (unlimited subjects) starts as low as €10.00 for a 10-day period.

var b = addblock(10,10,80,80,"cornsilk"),
    bStyle = b.node.firstChild.firstChild.style; // Gets the style object of the block

b.align('left');                    // alligns text to the left; standard NeuroTask Scripting function

bStyle.verticalAlign = "top";       // alligns text to the top; using CSS3
bStyle.padding = '3%';              // space around the text; adjust to your needs

b.text("<p><b>Title</b></p><p>Here, I am assuming you will have a very long text, which you would like to start in the upper left corner underneath the title all the way on top.",60);

console.log("Node",b.node.firstChild);


awaitkey('ESCAPE');

You can download the files as follows: Click on the file (link) and then right-click and choose Save as... from the menu. Some media files (e.g., sound) will have a download button for this purpose.

This experiment has no files of this type
This experiment has no files of this type
This experiment has no files of this type
This experiment has no YouTube links
This experiment has no files of this type