Interactivity window panel: two questions

Post questions on how to use or achieve an effect in Inkscape.
Ruciakjo
Posts: 2
Joined: Mon Jul 25, 2016 10:08 am

Interactivity window panel: two questions

Postby Ruciakjo » Mon Jul 25, 2016 10:14 am

great forum.

I have 2 questions about the Interactivity window panel.

In onclick, I can set opacity to 50% by [setAttribute('fill-opacity','0.5')] or [this.style.opacity=0.5].

Is there a list of things that can be achieved using the Interactivity window panel?

The second question is: Is it possible to change the opacity (or whatever feature) of another object using Interactivity window panel?

Ruciakjo
Posts: 2
Joined: Mon Jul 25, 2016 10:08 am

Re: Interactivity window panel: two questions

Postby Ruciakjo » Wed Jul 27, 2016 10:39 am

just found the interactivity panel and options...

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: Interactivity window panel: two questions

Postby v1nce » Wed Jul 27, 2016 10:30 pm

you can do whatever is permitted by javascript via interactivity (display message box, change color of all or some objects, show/hide layers, compute the first 1000 decimals of PI, play sound,zip file...) but you won't be able to test it in inkscape coz there's no javascript runtime.
you'll need to run the svg in a browser

if you want to address another object replace this.*** by document.getElementById("ID_of_the_second_object").***
eg document.getElementById("rect3355").style.opacity=0.5

document.getElementById("text3363").childNodes[0].innerHTML="foo text" will write foo text instead of current text in the text object with id "text3363"
childNodes[0] is because text in not written directly in a text objet but rather splitted in tspan sub object

you can ask for some input using window.prompt
var answer = window.prompt("Please enter your name");
document.getElementById("text3363").childNodes[0].innerHTML="Hello " + answer;


Return to “Help with using Inkscape”