fortesinformatica / Sideshow

Sideshow is a powerful javascript library which aims to reduce your user's learning curve by providing a way to create step-by-step interactive tours. Explain the features of your application, control your end-user's interaction with your UI, emphasize what you're explaining in each step by masking it. Just think! The sky is the limit!
http://fortesinformatica.github.io/Sideshow
Apache License 2.0
86 stars 31 forks source link

Position targets arrow #9

Closed DanielApt closed 9 years ago

DanielApt commented 9 years ago

I need to position the targets arrow to the side, instead of the top of the element. Something like the image below: screen shot 2015-03-16 at 14 21 22

I'm looking through the source code on how to achieve this.

I was thinking of adding this as a property for the step, so a step could look like this.

{
    title: 'Title',
    text: 'Description goes here',
    subject: '.main-nav',
    targets: '.main-nav li',
    arrowPosition: 'right' // positions the arrow to the right of the targets
}

My initial approach would be to pass this arrowPosition (or should we call it targetsPosition?) to the property Arrow class, and adjust the Arrow.positionate() method accordingly.

By default arrowPosition would be top (similar behaviour as happens currently), but we could allow supplying other properties. For now I had top, right, bottom, and left in mind.

We'd also need to provide new icons to the font file (caret-left, caret-right, etc), or we could continue to simply use the same arrow icon, and use transform: rotate(90deg) to make the arrow fit the position.

I've already started on something locally, and once I have something stable I can submit a PR, but advice would always be welcome.

DanielApt commented 9 years ago

I noticed this is a duplicate of #4

DanielApt commented 9 years ago

I'll be continuing the conversation in this issue, as this one is more focused on the implementation. For the ones interested, work in progress can be followed on my fork.

DanielApt commented 9 years ago

You can now position the arrow by using the arrowPosition property in a step.

See release v0.4.3