Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathslider responsive #9

Open
rr20eid10 opened this issue Aug 19, 2016 · 5 comments
Open

Pathslider responsive #9

rr20eid10 opened this issue Aug 19, 2016 · 5 comments

Comments

@rr20eid10
Copy link

Hi Rob,

Is there a way to make the pathslider responsive? Thanks!

@Mottie
Copy link
Owner

Mottie commented Aug 19, 2016

Hi @rr20eid10!

What exactly do you mean by responsive? Currently, if you resize the browser window, the grip position is updated to ensure it is still positioned correctly on the curve.

@rr20eid10
Copy link
Author

I'm not sure what's wrong but when I resize the browser (Chrome 52.0.x) the svg graph resizes, but the slider isn't resizing.

screen >1140px
range-borderbox-100a

screen <600px

range-borderbox-100-resize

<svg width="100%" height="100%" viewbox="0 0 800 600" preserveAspectRatio="none" class="graph" aria-labelledby="title" role="img">
                          <title id="title">Conversion</title>
                        <g class="grid x-grid" id="xGrid">
                          <line x1="90" x2="90" y1="5" y2="371" ></line>
                        </g>
                        <g class="grid y-grid" id="yGrid">
                          <line x1="90" x2="705" y1="370" y2="370"></line>
                        </g>
                          <g class="labels x-labels">
                          <text x="100" y="400">15</text>
                          <text x="190" y="400">25</text>
                         . . .
                        </g>
                        <g class="labels y-labels">
                          <text x="80" y="15">1K</text>
                         . . .

                        </g>
                        </svg>

@Mottie
Copy link
Owner

Mottie commented Aug 19, 2016

Would you please set up a JSFiddle demo. And make sure to use the files from the gh-pages domain:

@Mottie
Copy link
Owner

Mottie commented Aug 19, 2016

Hmm, maybe you can try this code: http://stackoverflow.com/questions/4288253/html5-canvas-100-width-height-of-viewport

Don't use the window dimensions! Instead use the div wrapper dimensions to apply to the canvas.

@rr20eid10
Copy link
Author

Hi Rob,

I read through the link on SO, thank you! There's a few answers there and although one is marked as the right answer, some commenters claim it's wrong. :) I'll have to read carefully.

Don't use the window dimensions! Instead use the div wrapper dimensions to apply to the canvas

I'm not sure I understand what you mean use div wrapper dimensions?

Here's a fiddle of my code. I don't know why nothing is displaying in the fiddle. Also, when I resize, the slider (in my browser Chrome on my box) turns black (it looses the gradient and the end gray color). When I refresh the window, the gradient returns, but turns to black again on resize. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants