Centering hyperlinks?

So, I'm working on a gamebook in the desktop version of Quest, and I was wondering if there's a way to center the hyperlinks without centering the rest of the text, as well?


I see what you want to do, but it seems not possible with the option in the online editor. Maybe there are more option on the desktop version, but I don't know about it

I try to put in the game script

JS.eval ("$('#divOutputAlign3').css('text-align', 'center');")

as divOutputAlign3 is the div with the hyperlinks, but the commands is overrided and i don't see anything changed.

I tried to applied it directly to the links

JS.eval ("$('.cmdlink.commandlink').css('text-align', 'center');")
JS.eval ("$('.cmdlink.commandlink').css('display', 'block');")

but it didn't show anymore, so I think you're stuck with it


@Selsynn
As you are using jQuery selectors, this will only modify the alignment of links that are already on screen when that script runs. So I'm assuming that you already have this script to run every turn.

However, in this case it won't work as you intend. Using #divOutputAlign3 will not help, as the number at the end of the ID will be different for every page.

.cmdlink.commandlink will find the link; but the link is contained within a span. Having the link centred within a box exactly the same size as it, when the box is at the left, won't look any different. What you want to do is align the span. In this case, what you want is something like:

JS.eval ("$('.commandlink:only-child').parent().css('text-align', 'center');")

which finds a command link on a line of its own (I think) and centres the containing element.


You're totally right about the id, I didn't check as I should.
Either your solution, or what I came up after does not work

I discover the section was the class for it and i add this selector.

JS.eval ("$('class[id^=\"section\"]').css('text-align', 'center');")

When I execute it in the console, it's all right and align the text.
When placed in the game script or a function called at the end of the passage,nothing is visible.

I think there is something that overrule us in quest gamebook motor.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums