Loading ...
Sorry, an error occurred while loading the content.
 

Slider: problem dragging when page loads

Expand Messages
  • rwallace1979
    When the page with my slider loads everything shows up correctly and if I click on one of the tick marks it works fine, but if I try and drag the handle on a
    Message 1 of 4 , Apr 7, 2006
      When the page with my slider loads everything shows up correctly and
      if I click on one of the tick marks it works fine, but if I try and
      drag the handle on a fresh load it doesn't work. Instead of being
      dragged left or right, it jumps straight to the last position. Then I
      can't drag it until I click on one of the tick marks. After that,
      dragging works properly. My code is below, any help would be greatly
      appreciated.

      <html>
      <head><title>Slider Test</title></head>
      <body>
      <script type="text/javascript"
      src="javascript/yahoo/YAHOO.js"></script>
      <script type="text/javascript"
      src="javascript/yahoo/dom.js"></script>
      <script type="text/javascript"
      src="javascript/yahoo/event.js"></script>
      <script type="text/javascript"
      src="javascript/yahoo/dragdrop.js"></script>
      <script type="text/javascript"
      src="javascript/yahoo/animation.js"></script>
      <script type="text/javascript"
      src="javascript/yahoo/slider.js"></script>

      <div id="sliderbg"
      style="position:relative;background:url(images/horizBg.png)
      no-repeat;height:36px;width:218px;zindex:5; ">
      <div id="sliderthumb"
      style="position:absolute;left:100px;top:8px;">
      <img src="images/horizSlider.png" />
      </div>
      </div>
      <script type="text/javascript">
      <!--
      var slider = YAHOO.widget.Slider.getHorizSlider("sliderbg",
      "sliderthumb", 100, 100, 25);
      //-->
      </script>
      </body>
      </html>

      Thanks,
      Rich
    • Matt Warden
      ... I asked this same question a while ago and never got an answer. Glad to see it s not just me, though. I was going to try calling slider.unlock(), as
      Message 2 of 4 , Apr 7, 2006
        On 4/7/06, rwallace1979 <rwallace@...> wrote:
        > When the page with my slider loads everything shows up correctly and
        > if I click on one of the tick marks it works fine, but if I try and
        > drag the handle on a fresh load it doesn't work. Instead of being
        > dragged left or right, it jumps straight to the last position. Then I
        > can't drag it until I click on one of the tick marks. After that,
        > dragging works properly. My code is below, any help would be greatly
        > appreciated.

        I asked this same question a while ago and never got an answer. Glad
        to see it's not just me, though. I was going to try calling
        slider.unlock(), as somsone suggested doing that for a different
        problem. You might want to give that a shot.


        --
        Matt Warden
        Miami University
        Oxford, OH, USA
        http://mattwarden.com


        This email proudly and graciously contributes to entropy.
      • rwallace1979
        ... I m glad to see I m not the only one running into this too. I tried calling slider.unlock() right after the slider is created, but that doesn t seem to
        Message 3 of 4 , Apr 7, 2006
          --- In ydn-javascript@yahoogroups.com, "Matt Warden" <mwarden@...> wrote:
          >
          > On 4/7/06, rwallace1979 <rwallace@...> wrote:
          > > When the page with my slider loads everything shows up correctly and
          > > if I click on one of the tick marks it works fine, but if I try and
          > > drag the handle on a fresh load it doesn't work. Instead of being
          > > dragged left or right, it jumps straight to the last position. Then I
          > > can't drag it until I click on one of the tick marks. After that,
          > > dragging works properly. My code is below, any help would be greatly
          > > appreciated.
          >
          > I asked this same question a while ago and never got an answer. Glad
          > to see it's not just me, though. I was going to try calling
          > slider.unlock(), as somsone suggested doing that for a different
          > problem. You might want to give that a shot.
          >

          I'm glad to see I'm not the only one running into this too. I tried
          calling slider.unlock() right after the slider is created, but that
          doesn't seem to have had any effect.

          Any other ideas?

          Rich
        • rwallace1979
          ... Then I ... greatly ... Well, I fixed the problem It was a major PITA to track down because, well, it wasn t my fault. =P The directory structure in the
          Message 4 of 4 , Apr 7, 2006
            --- In ydn-javascript@yahoogroups.com, "rwallace1979" <rwallace@...>
            wrote:
            >
            > --- In ydn-javascript@yahoogroups.com, "Matt Warden" <mwarden@> wrote:
            > >
            > > On 4/7/06, rwallace1979 <rwallace@> wrote:
            > > > When the page with my slider loads everything shows up correctly and
            > > > if I click on one of the tick marks it works fine, but if I try and
            > > > drag the handle on a fresh load it doesn't work. Instead of being
            > > > dragged left or right, it jumps straight to the last position.
            Then I
            > > > can't drag it until I click on one of the tick marks. After that,
            > > > dragging works properly. My code is below, any help would be
            greatly
            > > > appreciated.
            > >
            > > I asked this same question a while ago and never got an answer. Glad
            > > to see it's not just me, though. I was going to try calling
            > > slider.unlock(), as somsone suggested doing that for a different
            > > problem. You might want to give that a shot.
            > >
            >
            > I'm glad to see I'm not the only one running into this too. I tried
            > calling slider.unlock() right after the slider is created, but that
            > doesn't seem to have had any effect.
            >
            > Any other ideas?
            >

            Well, I fixed the problem It was a major PITA to track down because,
            well, it wasn't my fault. =P

            The directory structure in the zip from Yahoo! is kinda strange, but
            it looks like your supposed to use the code from the various build
            directories since that's what the readme.txt says is "production" code.

            That's what I was using, but that code is different than the code used
            in the examples. Doing a couple of quick diffs showed vast
            differences between the build javascript files and those used in the
            examples. I replaced the javascript I had been using with the example
            javascript and everything started working just as it should.

            Anyone know why there is a difference between the "production" code in
            the build directories and the stuff that actually works in the example
            directories?

            Rich
          Your message has been successfully submitted and would be delivered to recipients shortly.