I am writing a site which needs me to give the user a table of dates of the current month to be able to select one or more dates to query a database.
 
I have written a widget which provides me with two types of buttons - one which is the date buttons themselves (they act as checkboxes) and the other which gives the user the ability to select a different month from the current one.
 
The complete code for the widget is below. My problem is in netscape (using 4.7). When the user clicks on one of the month buttons, the code executes the location change, but does not complete to the end of the mouse down function. Therefore, when the new page loads, the mousedown event is still active and the page acts as though the user has the left mouse button down - ie. selecting all the html on the page.
 
Any help to get around this would be greatly appreciated.
 
Regards, Ben
 
--------------------code start -----------------------------
 
DynLayer.prototype.setBckGrdImg=function(obj) {
 this.bgImage=obj+'.src';
 if (this.css==null) return;
 if (is.ns4) {
  this.elm.background.src="obj.src;  if (!obj) this.setBgColor(this.getBgColor());
 }
 else this.css.backgroundImage='url('+obj.src+')';
};
 
function button(x,y,w,h,caption,imgOn,imgOff,month,year) {
 this.superClass=DynLayer
 this.superClass()
 this.id="button"+(button.Count++)
 
 this.moveTo(x||0,y||0)
 this.setSize(w||0,h||0)
 
 this.caption=caption||''
 this.imgDir='images/left_nav/'
 this.imgOn = new Image()
 this.imgOn.src="this.imgDir+imgOn this.imgOff = new Image()
 this.imgOff.src="this.imgDir+imgOff 
 this.selected=false
 
 var l=new EventListener(this)
 l.oncreate=function(e) {
  var o=e.getTarget()
  o.setBckGrdImg(o.imgOff)
  
  o.dyncaption=new DynLayer(null,0,0,o.w,o.h)
  
  if (o.caption.length>2) o.caption=''
  
  o.dyncaption.setHTML('<center>'+o.caption+'</center>')
 
  o.addChild(o.dyncaption)
  o.setVisible(true)
  
  o.dynTopLayer=new DynLayer(null,0,0,o.w,o.h)
  o.addChild(o.dynTopLayer)
  o.setVisible(true)
  
 }
 
 l. {
  var o = e.getTarget()
  if (month) {
   if (year) {
    parent.frames[1].location="cl_nav.php?month="+month+"&year="+year
   } else {
    parent.frames[1].location="cl_nav.php?month="+month   
   }
  } else {
   o.selected?o.setBckGrdImg(o.imgOff):o.setBckGrdImg(o.imgOn)
   o.selected?o.selected=false:o.selected=true
  }
  return false
 }
 
 l. {
  var o=e.getTarget()
  o.selected?'':o.setBckGrdImg(o.imgOn)
 }
 
 l. {
  var o=e.getTarget()
  o.selected?'':o.setBckGrdImg(o.imgOff)  
  return false
 }
 
 this.addEventListener(l)
 
 return this
}
button.Count=0
button.prototype=new DynLayer()
button.prototype.getSubClass=function() { return button }
 
------------------code finish------------------------

Reply via email to