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

Re: Slider left and right constraints being reset

Expand Messages
  • Bart Gottschalk
    I ve modified my code to now use the setValue method on the slider. With that change I m not able to reproduce the error I described below. Here is the new
    Message 1 of 2 , Sep 30 12:04 PM
      I've modified my code to now use the setValue method on the slider.
      With that change I'm not able to reproduce the error I described below.

      Here is the new code (from several different files):

      //create new slider

      StoreLocator.prototype.createSlider =

      //set the initial zoom level for later
      iniZoomLevel = iniZoomLevelVal;

      //Create zoom slider. Intentionally not a 'var' type variable to
      protect from multiple browser windows at the same time.
      horizontalSlider =

      //set onSlideEnd property on slider
      horizontalSlider.onSlideEnd = sliderZoomTo;

      //set onendzoom event for map so that we can reposition the slider if
      the zoom was initiated another way.
      this.map.AttachEvent("onendzoom", setZoomSlider);

      //set the slider after it's initialzed the the starting zoom level

      function setZoomSlider(e) {

      StoreLocator.prototype.setZoomSliderOffset = function(zoomLevel){

      // create variable for new Offset
      var newOffset = 0;

      //code to determine appropriate value for newOffset...

      //set the newOffset value on slider horizontalSlider

      I've tested this a fair amount and haven't seen the left and right
      constraints reset. However, as I wasn't able to do this through a
      known process earlier I might just still be getting lucky. I'll post
      again if the problem resurfaces.


      --- In ydn-javascript@yahoogroups.com, "Bart Gottschalk"
      <bartgottschalk@...> wrote:
      > The YAHOO.widget.Slider I'm implementing is a custom control for a
      > Virtual Earth zoom bar. I also have custom zoom-in and zoom-out
      > buttons on the page as well as the double-click to zoom and center
      > functionality enabled.
      > When the double-click or zoom-in/zoom-out functions are called I also
      > respoition the sliders thumb to correspond to the new zoom level.
      > Through some combination of events (I haven't been able to document
      > the specific combination yet) the left and right constraints of the
      > slider are being altered. Here is the code I'm using to change the
      > location of the slider:
      > //get the slider div
      > var slider = DOMUtils.getElement("horizHandleDiv_ajax");
      > //set the new x offset for the slider
      > slider.style.left = newOffset + "px";
      > Notice that I'm not doing this through the Yahoo.widget.Slider API.
      > I'm going directly to the DOM element and changing it's style.left
      > value. Is this a no-no? I've started to look at the setValue method
      > available on the slider API as another option
      > Has anyone else implemented a slider and seen this type of behavior?
      > Any suggestions of things I should try to isolate the problem?
      > Thanks!
      > Bart
    Your message has been successfully submitted and would be delivered to recipients shortly.