Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use javascript method

Status
Not open for further replies.

mike232

Programmer
Mar 25, 2009
5
PL
Hello

j'm working on joomla website where j have gallery which use method goTo to display selected slide. The problem is that j want to use the same method from my module. How can j do this.

Thank you for any answer
 
You'll (sorry, j'll) have to provide a bit more information, such as some code examples or URL.

Right now, we know the square root of nothing about your code or your module.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 

The gallery code which load into website is :

<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
/* Automated slideshow */
timed: true,
/* Show the thumbs carousel */
showCarousel: true,
/* Text on carousel tab */
textShowCarousel: 'Thumbs',
/* Thumbnail height */
thumbHeight: 50,
/* Thumbnail width*/
thumbWidth: 50,
/* Fade duration in milliseconds (500 equals 0.5 seconds)*/
fadeDuration: 500,
/* Delay in milliseconds (6000 equals 6 seconds)*/
delay: 6000
});
}
window.addEvent('domready',startGallery);
</script>


inside the gallery object j found method :

goTo: function(num) {
this.clearTimer();
if(this.options.preloader)
{
this.galleryElements[num].load();
if (num==0)
this.galleryElements[this.maxIter - 1].load();
else
this.galleryElements[num - 1].load();
if (num==(this.maxIter - 1))
this.galleryElements[0].load();
else
this.galleryElements[num + 1].load();

}
if (this.options.embedLinks)
this.clearLink();
if (this.options.showInfopane)
{
this.slideInfoZone.clearChain();
this.hideInfoSlideShow().chain(this.changeItem.pass(num, this));
} else
this.currentChangeDelay = this.changeItem.delay(500, this, num);
if (this.options.embedLinks)
this.makeLink(num);
this.prepareTimer();
/*if (this.options.showCarousel)
this.clearThumbnailsHighlights();*/
}

after user click thumbnails in gallery it shows picture
in gallery.


What j want to do is to make another thumbanils photos
in my website. Which is allready done.
and now when user click on one of thumbanils it supposed to show correct picture in gallery. The same like it works within gallery.
 
If I understand you correctly, you want to have multiple sets of thumbnails pointing to the same gallery.

Which gallery script are you using, and does it support this out of the box?

If it doesn't, are you able to simply call the goTo method yourself from your own set of thumbnails?

P.S. Why do you use 'j' instead of 'i'?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Yes I want multiple sets of thumbanils.
The gallery name is RSGallery2.
Yes it support for control out of the box.
After using goto method nothing happend.

Ps: it's just mistake.




 
If it has out-of-the-box support for multiple sets of thumbnails pointing to the same gallery, why do you not use that functionality instead of trying to roll your own?



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
The most important question is it posible?. I was looking on joomla websites modules like this and j coudn't find anything which could show me how I can interact with slidshow/galleries.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top