S
sebzzz
Hi,
I'm doing an image slide show on a web site: http://www.solutions-linux.org/congrescma/comite.php
I use a tool called smooth gallery (http://
smoothgallery.jondesign.net/
showcase/manual-slideshow/) that uses Mootools itself.
However, I don't want the arrows inside the image box, I want the user
to be able to click on arrows that are pictures outside the box.
The code that handles the click on the original version is as follow:
if
((this.galleryData.length>1)&&(this.options.showArrows))
{
var leftArrow = new
Element('a').addClass('left').addEvent(
'click',
this.prevItem.bind(this)
).injectInside(element);
var rightArrow = new
Element('a').addClass('right').addEvent(
'click',
this.nextItem.bind(this)
).injectInside(element);
this.galleryElement.addClass(this.options.withArrowsClass);
}
I changed the code to this:
if
((this.galleryData.length>1)&&(this.options.showArrows))
{
var leftArrow =
document.getElementById("flgauche").addEvent(
'click',
this.prevItem.bind(this));
var rightArrow =
document.getElementById("fldroit").addEvent(
'click',
this.nextItem.bind(this));
this.galleryElement.addClass(this.options.withArrowsClass);
}
Basically, I removed a call to the injectInside method that puts the
arrows inside the box and I used the same addEvent method but with my
already existing objects (flgauche and fldroit). It works fine in
Firefox, but doesn't work in IE6 nor 7. It tells me that the object
doesn't support the method.
My thinking is that the value of document.getElementById("flgauche")
doesn't support the addEvent method, but I'm puzzled as to how to do
it so it works fine.
Thanks in advance
I'm doing an image slide show on a web site: http://www.solutions-linux.org/congrescma/comite.php
I use a tool called smooth gallery (http://
smoothgallery.jondesign.net/
showcase/manual-slideshow/) that uses Mootools itself.
However, I don't want the arrows inside the image box, I want the user
to be able to click on arrows that are pictures outside the box.
The code that handles the click on the original version is as follow:
if
((this.galleryData.length>1)&&(this.options.showArrows))
{
var leftArrow = new
Element('a').addClass('left').addEvent(
'click',
this.prevItem.bind(this)
).injectInside(element);
var rightArrow = new
Element('a').addClass('right').addEvent(
'click',
this.nextItem.bind(this)
).injectInside(element);
this.galleryElement.addClass(this.options.withArrowsClass);
}
I changed the code to this:
if
((this.galleryData.length>1)&&(this.options.showArrows))
{
var leftArrow =
document.getElementById("flgauche").addEvent(
'click',
this.prevItem.bind(this));
var rightArrow =
document.getElementById("fldroit").addEvent(
'click',
this.nextItem.bind(this));
this.galleryElement.addClass(this.options.withArrowsClass);
}
Basically, I removed a call to the injectInside method that puts the
arrows inside the box and I used the same addEvent method but with my
already existing objects (flgauche and fldroit). It works fine in
Firefox, but doesn't work in IE6 nor 7. It tells me that the object
doesn't support the method.
My thinking is that the value of document.getElementById("flgauche")
doesn't support the addEvent method, but I'm puzzled as to how to do
it so it works fine.
Thanks in advance