CamanJS icon indicating copy to clipboard operation
CamanJS copied to clipboard

problem with jquery slider

Open moham-MA-d opened this issue 10 years ago • 4 comments

i want to manipulate brigthness of an image with jquery slider, but when jquery slider is triggerd the image transforms to a solid black, white, gray, dark gray, light gray and etc, depends on slider range.

`

 var $this;
 Caman("#canvas", "/Images/pic.png", function () {
            $this = this;
   });
 $("#slider-range").slider({
       min: -100,
       max: 100,
       value: 0,
       slide: function (event, ui) {
                $this.brightness(ui.value).render();  

       }
});

`

moham-MA-d avatar Apr 19 '14 08:04 moham-MA-d

I have this problem also ... Please help us ...

paradisehuman avatar Apr 29 '14 06:04 paradisehuman

Because of how the slider works, you're calling render before the previous render finishes. Make sure the render calls don't overlap.— Ryan LeFevre (@meltingice) LayerVault Software Engineer

On Tue, Apr 29, 2014 at 2:50 AM, Ahmad Khojasteh [email protected] wrote:

I have this problem also ...

Please help us ...

Reply to this email directly or view it on GitHub: https://github.com/meltingice/CamanJS/issues/143#issuecomment-41646204

meltingice avatar Apr 29 '14 13:04 meltingice

What do you mean by that ? You mean after slider finished the change event , then I call caman function? Can you Explain by code ? Thanks in advance.

moham-MA-d avatar Apr 29 '14 16:04 moham-MA-d

Check out the code from the CamanJS site. It keeps track of when the Caman instance is rendering and doesn't allow render calls to overlap.

meltingice avatar May 06 '14 11:05 meltingice