Oh forgot to post my code. Sorry its all a bit of a mess but hope you
will be able to see what I am making wrong.


<style type="text/css">
  div.slider { width:<?php echo $maxwidth;?>px; margin:10px 0;
background-color:#ccc; height:10px; position: relative; }
  div.slider div.handle { width:10px; height:15px; background-
color:#f00; cursor:move; position: absolute; }
  div#zoom_element { width:50px; height:50px; background:#2d86bd;
position:relative; }
</style>



<div class="demo">
  <p>Use Slider Below to resize image</p>
  <div id="zoom_slider" class="slider">
    <div class="handle"></div>
  </div>
</div>

<div class="demo">
  <p>Use Slider Below to change height</p>
  <div id="height_slider" class="slider">
    <div class="handle"></div>
  </div>
</div>

<p>You can also Drag the Image into the desired position</p>

<div style="float: left; width: <?php echo $maxwidth;?>px; height:
240px; background-color: pink; overflow: hidden; border: 1px solid
black;" id="height">

                <img src="<?php echo $url;?>img/large/<?php echo $_GET['img'];?
>" id="himg" style="top: 0px; left: 0px;position: relative; width: <?
php echo $width;?>px; "/>
                </div>


<script src="javascripts/scriptaculous.js?load=effects,dragdrop"
type="text/javascript"></script>

<script type="text/javascript">
new Draggable('himg', { revert: false });


  (function() {


    var zoom_slider = $('zoom_slider'),
    height_slider = $('height_slider'),
        box = $('himg'),
                wrap = $('height');

    new Control.Slider(zoom_slider.down('.handle'), zoom_slider, {
      range: $R(0, <?php echo $width;?>),
      sliderValue: <?php echo $width;?>,
      onSlide: function(value) {
       var ratio = <?php echo $ratio;?>;
        var heightt = value * ratio;
        box.setStyle({ width: value + 'px', height: heightt + 'px' });
      },
      onChange: function(value) {
        var ratio = <?php echo $ratio;?>;
        var heightt = value * ratio;
        box.setStyle({ width: value + 'px', height: heightt + 'px' });
      }
    });


    new Control.Slider(height_slider.down('.handle'), height_slider, {
      range: $R(0, <?php echo $height;?>),
      sliderValue: <?php if(isset($_POST['orimgwidth'])) { echo
$_POST['imgheight'];}else { echo 240;}?>,
      onSlide: function(value) {

        wrap.setStyle({ width: '<?php echo $maxwidth;?>px', height:
value + 'px' });
      },
      onChange: function(value) {

        wrap.setStyle({ width:  '<?php echo $maxwidth;?>px', height:
value + 'px' });
      }
    });

  })();

</script>

On Feb 9, 3:00 pm, Stephan <[email protected]> wrote:
> Hello,
>
> I have created a little tool that lets me resize and crop images
> online. It is working great. Now I have taken the code and pasted into
> another website and I get the following error
>
> Error: this.handles[0] is undefined
> Source File: http://**********/javascript/slider.js
> Line: 54
>
> Does someone have any idea why this could be and what could causes
> this error?
>
> Thanks for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to