Search the web
Sign In
New User? Sign Up
ycarousel · Bill Scott's Carousel Component
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 438 - 470 of 506   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#470 From: "jamartos2000" <jmartos@...>
Date: Tue Nov 25, 2008 2:27 pm
Subject: Problem whith 100 or more elements at the scroll bar
jamartos2000
Offline Offline
Send Email Send Email
 
Hello,
I don't know if I have the last version of Yahoo Carousel Component.
I have a problem with IE 7 when the array size is over than 100
elements, the scroll bar no show the thumbnails at 100 or more
positions . This problem no exist in Firefox. Do you know if this
problem exist at old version of Carousel.

My Carousel page is
http://www.iluana.com/galeria_ficha.asp?idgaleria=61

There are no problem when the size is minus than 100 elements.

Thank for your help and sorry for my english

---------------------

Hola. No sé si tengo instalada la última versión del Carrusel de
Yahoo. Tengo un problema con IE 7 cuando el scroll muestra más de 100
elementos. Los elementos superiores al 100 no aparecen. Si el tamaño
de la matriz es menor que 100 no hay problemas. La página donde
utilizo el carrusel es ésta.
http://www.iluana.com/galeria_ficha.asp?idgaleria=61

Gracias y un saludo

#469 From: "David Karr" <davidmichaelkarr@...>
Date: Fri Nov 14, 2008 10:27 pm
Subject: Re: too much recursion problem.
davidmichael...
Offline Offline
Send Email Send Email
 
I had recursion issues with it on IE when I tried to set a relatively "high" animation speed.  When I set it back down to .25, it worked fine.

On Fri, Nov 14, 2008 at 2:10 PM, dexxaye <dexxaye@...> wrote:

hello. i am having the above problem with the carousel.

my code:

var carousel = new
YAHOO.extension.Carousel("gallery-horizontal-carousel",
{
numVisible: 3,
animationSpeed: 0.8,
scrollInc: 1,
size: 20,
wrap: true,
autoPlay: 2500
}
);

carousel.setProperty('size',2,true);

this is my setup and it's giving me too much recursion problem. and
it's caused by
carousel.setProperty('size',2,true);

basically i just want it to wrap as soon as it loops through all the
li's. if i dont set size. it wraps at 10000000. if i do set the size
and if i have less item than the size. it shows blank spots.
please help.



#468 From: "dexxaye" <dexxaye@...>
Date: Fri Nov 14, 2008 10:10 pm
Subject: too much recursion problem.
dexxaye
Offline Offline
Send Email Send Email
 
hello. i am having the above problem with the carousel.

my code:

var carousel = new
YAHOO.extension.Carousel("gallery-horizontal-carousel",
	     {
		     numVisible:        3,
             animationSpeed:    0.8,
             scrollInc:         1,
             size:              20,
             wrap:              true,
             autoPlay:          2500
	     }
	     );

carousel.setProperty('size',2,true);

this is my setup and it's giving me too much recursion problem. and
it's caused by
carousel.setProperty('size',2,true);

basically i just want it to wrap as soon as it loops through all the
li's. if i dont set size. it wraps at 10000000. if i do set the size
and if i have less item than the size. it shows blank spots.
please help.

#467 From: "David Karr" <davidmichaelkarr@...>
Date: Thu Nov 6, 2008 2:35 pm
Subject: Re: Re: Remove item from Carousel
davidmichael...
Offline Offline
Send Email Send Email
 
I'd say the first thing you should do is convert to YUI 2.6.0, which provides the Carousel component, which was based on Bill Scott's Carousel.  That being said, I wouldn't be surprised if you found issues with dynamic addition and removal of items.  I had some trouble with that when I tried to build something with Bill Scott's Carousel, and in the YUI list I noticed a couple of people with similar issues. I also noticed on the list that Gopal (the author of the new YUI Carousel) provided a patch for some of these issues.

On Wed, Nov 5, 2008 at 11:25 PM, adrisalarfdez <adrisalarfdez@...> wrote:

Have you done what you said? I have a similar problem... I need to
replace items... so I can remove items for adding some new...

Can someone help me, please?

Thank you

--- In ycarousel@yahoogroups.com, "tpthaler" <tpthaler@...> wrote:
>
> Hello,
>
>
> I've been building an admin interface (AJAX'Y) that dynamically
> adds images to the carousel using the wonderful insertBefore and
> insertAfter methods, but there is no remove method.... I could really
> use this, and I am about to try and figure out how to write my own but
> if someone has already done this it would be greatly appreciated if
> you could share your code!
>
> Thanks,
> Tim
>



#466 From: "adrisalarfdez" <asalar@...>
Date: Thu Nov 6, 2008 9:17 am
Subject: Re: First visible items
adrisalarfdez
Offline Offline
Send Email Send Email
 
Oh, I solved it... my problem was that I reload the data (not the
items) when a condition is true in the load function... and this
condition was wrong... Thank you!


--- In ycarousel@yahoogroups.com, "adrisalarfdez" <asalar@...> wrote:
>
> Ahh!! The code of my animationCompleteHandler is:
> var handleAnimationComplete = function(type, args) {
>  if (this.getFirstVisible() == 1) {
> 	 carousel.reload(this.getProperty("numVisible"));
> 	 this.startAutoPlay(this.getProperty("autoPlay"));
>  }
> };
>
> --- In ycarousel@yahoogroups.com, "adrisalarfdez" <asalar@> wrote:
> >
> > Hi,
> > I have a vertical carousel with autoPlay and wrap... and I need to
> > reload all the visible Items every time I'm going to show them...
> >
> > I can clear or reload all the carousel when it goes to my
> > animationCompleteHandler, checking if the index returning with
> > getFirstVisible() is 1...
> >
> > It works fine but it clear or reload all the items AFTER the first
> > visible items. These are the same always and the rest of the items are
> > changing correctly
> >
> > How can I solve it?
> >
> > Thank you.
> >
>

#465 From: "adrisalarfdez" <asalar@...>
Date: Thu Nov 6, 2008 9:00 am
Subject: Re: First visible items
adrisalarfdez
Offline Offline
Send Email Send Email
 
Sorry, it was wrong... the code of the handler is this:
(without this boolean it doesn't work)

var noPrime = false;

var handleAnimationComplete = function(type, args) {
	 if (this.getFirstVisible() == 1 && noPrime) {
		 this.reload(this.getProperty("numVisible"));
		 this.startAutoPlay(this.getProperty("autoPlay"));
		 noPrime = false;
	 }
	 else {
		 noPrime = true;
	 }
};



--- In ycarousel@yahoogroups.com, "adrisalarfdez" <asalar@...> wrote:
>
> Ahh!! The code of my animationCompleteHandler is:
> var handleAnimationComplete = function(type, args) {
>  if (this.getFirstVisible() == 1) {
> 	 carousel.reload(this.getProperty("numVisible"));
> 	 this.startAutoPlay(this.getProperty("autoPlay"));
>  }
> };
>
> --- In ycarousel@yahoogroups.com, "adrisalarfdez" <asalar@> wrote:
> >
> > Hi,
> > I have a vertical carousel with autoPlay and wrap... and I need to
> > reload all the visible Items every time I'm going to show them...
> >
> > I can clear or reload all the carousel when it goes to my
> > animationCompleteHandler, checking if the index returning with
> > getFirstVisible() is 1...
> >
> > It works fine but it clear or reload all the items AFTER the first
> > visible items. These are the same always and the rest of the items are
> > changing correctly
> >
> > How can I solve it?
> >
> > Thank you.
> >
>

#464 From: "adrisalarfdez" <asalar@...>
Date: Thu Nov 6, 2008 8:51 am
Subject: Re: First visible items
adrisalarfdez
Offline Offline
Send Email Send Email
 
Ahh!! The code of my animationCompleteHandler is:
var handleAnimationComplete = function(type, args) {
	 if (this.getFirstVisible() == 1) {
		 carousel.reload(this.getProperty("numVisible"));
		 this.startAutoPlay(this.getProperty("autoPlay"));
	 }
};

--- In ycarousel@yahoogroups.com, "adrisalarfdez" <asalar@...> wrote:
>
> Hi,
> I have a vertical carousel with autoPlay and wrap... and I need to
> reload all the visible Items every time I'm going to show them...
>
> I can clear or reload all the carousel when it goes to my
> animationCompleteHandler, checking if the index returning with
> getFirstVisible() is 1...
>
> It works fine but it clear or reload all the items AFTER the first
> visible items. These are the same always and the rest of the items are
> changing correctly
>
> How can I solve it?
>
> Thank you.
>

#463 From: "adrisalarfdez" <asalar@...>
Date: Thu Nov 6, 2008 8:47 am
Subject: First visible items
adrisalarfdez
Offline Offline
Send Email Send Email
 
Hi,
I have a vertical carousel with autoPlay and wrap... and I need to
reload all the visible Items every time I'm going to show them...

I can clear or reload all the carousel when it goes to my
animationCompleteHandler, checking if the index returning with
getFirstVisible() is 1...

It works fine but it clear or reload all the items AFTER the first
visible items. These are the same always and the rest of the items are
changing correctly

How can I solve it?

Thank you.

#462 From: "adrisalarfdez" <adrisalarfdez@...>
Date: Thu Nov 6, 2008 7:25 am
Subject: Re: Remove item from Carousel
adrisalarfdez
Offline Offline
Send Email Send Email
 
Have you done what you said? I have a similar problem... I need to
replace items... so I can remove items for adding some new...

Can someone help me, please?

Thank you

--- In ycarousel@yahoogroups.com, "tpthaler" <tpthaler@...> wrote:
>
> Hello,
>
>
>      I've been building an admin interface (AJAX'Y) that dynamically
> adds images to the carousel using the wonderful insertBefore and
> insertAfter methods, but there is no remove method.... I could really
> use this, and I am about to try and figure out how to write my own but
> if someone has already done this it would be greatly appreciated if
> you could share your code!
>
> Thanks,
> Tim
>

#461 From: David Kinniburgh <davidgkinniburgh@...>
Date: Wed Oct 15, 2008 8:38 am
Subject: Re: YUI 2.6.0 Carousel Component
davidgkinnib...
Offline Offline
Send Email Send Email
 
Bill

Thanks very much for your efforts in providing the original carousel and I'm sure your component gave Yahoo a little push in the right direction.

David Kinniburgh

----- Original Message ----
From: billwaynescott <billwaynescott@...>
To: ycarousel@yahoogroups.com
Sent: Tuesday, 14 October, 2008 18:18:20
Subject: [ycarousel] YUI 2.6.0 Carousel Component

As you know, the intent of my carousel component was to fill in a gap
in the YUI library. In 2006, I created the ycarousel component. Many
people have found it useful over the last 2 years.

On October 1, 2008 Yahoo! announced the release of YUI 2.6.0. This
release contained the official YUI Carousel component.

Before I left Yahoo! in 2007, I spent some time with the YUI team,
discussed the ideas behind the way I approached my component, what I
liked about it and more importantly what I did not like about it :-)

The newly released YUI component shares some of the same
properties/api with my component but has been written from the ground
up. In 2006 when I wrote the carousel there were some features in YUI
that are available now that weren't then. So I am excited about their
new carousel and encourage everyone to migrate to it instead of using
my carousel.

The fact is you will get better support for their component. I am just
too busy with other projects to really support it the way I would like
and there is just no reason to cloud the space with two components
(named similarly ;-)

You can find the new YUI Carousel component here:
http://developer. yahoo.com/ yui/carousel/

--
Bill Scott



#459 From: "billwaynescott" <billwaynescott@...>
Date: Tue Oct 14, 2008 5:18 pm
Subject: YUI 2.6.0 Carousel Component
billwaynescott
Offline Offline
Send Email Send Email
 
As you know, the intent of my carousel component was to fill in a gap
in the YUI library. In 2006, I created the ycarousel component. Many
people have found it useful over the last 2 years.

On October 1, 2008 Yahoo! announced the release of YUI 2.6.0. This
release contained the official YUI Carousel component.

Before I left Yahoo! in 2007, I spent some time with the YUI team,
discussed the ideas behind the way I approached my component, what I
liked about it and more importantly what I did not like about it :-)

The newly released YUI component shares some of the same
properties/api with my component but has been written from the ground
up. In 2006 when I wrote the carousel there were some features in YUI
that are available now that weren't then. So I am excited about their
new carousel and encourage everyone to migrate to it instead of using
my carousel.

The fact is you will get better support for their component. I am just
too busy with other projects to really support it the way I would like
and there is just no reason to cloud the space with two components
(named similarly ;-)

You can find the new YUI Carousel component here:
http://developer.yahoo.com/yui/carousel/

--
Bill Scott

#458 From: "David Karr" <davidmichaelkarr@...>
Date: Thu Oct 2, 2008 4:47 am
Subject: YUI 2.6.0 released with Carousel component
davidmichael...
Offline Offline
Send Email Send Email
 
Note that today YUI 2.6.0 was released, with a new native YUI Carousel component. It's obviously based on Bill Scott's Carousel component, with a similar interface, but some additional features.  The code looks quite different.  I inspected it to see if it might have a similar problem to what I saw in the "clear()" method, but I don't see anything like that structure.  I haven't yet tried to convert the Carousel usage in my application to the new YUI component.

#457 From: "DavidTobias" <davidtobias@...>
Date: Thu Oct 2, 2008 3:33 am
Subject: Rewind Effect
DavidTobias
Offline Offline
Send Email Send Email
 
Hello,

I am using the Carousel on a client site and it is working nicely.

We have autoPlay set and wrap is set to true.  We have five items in
the carousel.  When the last item finishes, the Carousel does
a "rewind" effect back to the first item.

Is there a way to turn this effect off?  We would like to go from item
5 to Item 1 with the same animationMethod that is used during the other
scrolls.

Thanks

#456 From: "alexhauer_at" <alex.hauer@...>
Date: Wed Oct 1, 2008 4:54 pm
Subject: Can't set the size of the carousel to what I want
alexhauer_at
Offline Offline
Send Email Send Email
 
Heyho,

okay, so this question's probably very easy to answer and you all
going to blame why I didn't search on the Internet prior to posting,
but I did and didn't find a solution.

Problem should be simple: I want my carousel to work like the
"Spotlight" example
(http://billwscott.com/carousel/carousel_spotlight.html), but the
carousel having another width (in my case 750px).

The spotlight thing works great, but the size of my carousel is way
too big.

First thing I did was to set the size of all the containers via CSS to
750px, but that had no effect. Actually, to me it seems that the only
thing that changes the size is either how big I set the "li" items
(should be 175px, 125px image width +25px margin on left/right, no
borders) or what value I hand over to the "numVisible" attribute.
Setting the numVisible to a number like ~3 almost gets me to where I
want, the carousel has almost the correct size now - but the
highlighted image's not in the middle of the carousel anymore.
I read through the documentation several times now, looked up the
newsgroup and asked Google, but I didn't find a solution so far =/.

So what I want is that the carousel is exactly 750px wide and the
spotlighted image should be in the middle. Any suggestions?

CSS:
.carousel-component {
     width: 750px;
     height: 139px;
     padding:0px;
}

.carousel-component .carousel-list li {
     margin-left:25px;
     margin-right:25px;
     width: 175px;
     height: 139px;
     /*    margin-left: auto;*/ /* for testing IE auto issue */
}

.carousel-component .carousel-list li a {
     display:block;
     /* margin:3px; */
     outline:none;
     -moz-outline:none;
}

.carousel-component .carousel-list li a:hover {

}

.carousel-component .carousel-list li img {
     display:block;
     margin:4px 0px 0px 4px;
}

.carousel-component .carousel-list li strong {
     display:block;
}

.spotlight {
     filter: alpha(opacity=100); -moz-opacity:1.0;
}

.non-spotlight {
     filter: alpha(opacity=60); -moz-opacity:0.6;
}

Javascript:
<script type="text/javascript">

var priorCenterItem = 1;

/**
  * Image src URLs
  **/
var imageList = [
                  "images/subnav_praxen.jpg",
                  "images/subnav_karriere.jpg",
                  "images/subnav_vertretungen.jpg",
                  "images/subnav_weiterbildung.jpg",
                  "images/subnav_kooperation.jpg"
                  ];
var urlList = [
                  "images/subnav_praxen.jpg",
                  "images/subnav_karriere.jpg",
                  "images/subnav_vertretungen.jpg",
                  "images/subnav_weiterbildung.jpg",
                  "images/subnav_kooperation.jpg"
                  ];

var lastRan = -1;

/**
  * Since carousel.addItem uses an HTML string to create the interface
  * for each carousel item, this method formats the HTML for an LI.
  **/

var fmtItem = function(imgUrl, url, title, i) {
       var innerHTML =
           '<img id="carousel-image-' + i + '" src="' +
           imgUrl +
         '" width="' +
         125 +
         '" height="' +
         139+
         '"/>';
         /* <a id="carousel-anchor-' + i + '" href="' +
           url +
           '">' +
           title + '<\/a>'; */

     return innerHTML;

};

/**
  * Custom inital load handler. Called when the carousel loads the initial
  * set of data items. Specified to the carousel as the configuration
  * parameter: loadInitHandler
  **/
var loadInitialItems = function(type, args) {
     var start = args[0];
     var last = args[1];

     load(this, start, last);
     spotlight(this);
     preview(this);
};

/**
  * Custom load next handler. Called when the carousel loads the next
  * set of data items. Specified to the carousel as the configuration
  * parameter: loadNextHandler
  **/
var loadNextItems = function(type, args) {
     // get the last middle item and turn off spotlight
     var li = this.getItem(priorCenterItem);

     var start = args[0];
     var last = args[1];
     var alreadyCached = args[2];

     if(!alreadyCached) {
         load(this, start, last);
     }
     spotlight(this);
     preview(this);
};

/**
  * Custom load previous handler. Called when the carousel loads the
previous
  * set of data items. Specified to the carousel as the configuration
  * parameter: loadPrevHandler
  **/

var loadPrevItems = function(type, args) {
     // get the last middle item and turn off spotlight
     var li = this.getItem(priorCenterItem);

     var start = args[0];
     var last = args[1];
     var alreadyCached = args[2];

     if(!alreadyCached) {
         load(this, start, last);
     }
     spotlight(this);
     preview(this);
};

var load = function(carousel, start, last) {

     for(var i=start;i<=last;i++) {
         // var randomIndex = getRandom(18, lastRan);
         // lastRan = randomIndex;
         carousel.addItem(i, fmtItem(imageList[i], urlList[i], "Number
" + i, i), 'non-spotlight');

         // Image click will scroll to the corresponding carousel item.
         YAHOO.util.Event.addListener('carousel-image-'+i, 'click',
function(evt) {
             this.carousel.scrollTo(this.index-2);
         }, {carousel:carousel,index:i}, true);
/*
         // Example of an alternate way to add an item (passing an
element instead of html string)
         var p = document.createElement("P");
         var t = document.createTextNode("Item"+i);
         p.appendChild(t);
         carousel.addItem(i, p );
*/
     }
};

var getRandom = function(max, last) {
     var randomIndex;
     do {
         randomIndex = Math.floor(Math.random()*max);
     } while(randomIndex == last);

     return randomIndex;
};

/**
  * Custom button state handler for enabling/disabling button state.
  * Called when the carousel has determined that the previous button
  * state should be changed.
  * Specified to the carousel as the configuration
  * parameter: prevButtonStateHandler
  **/
var handlePrevButtonState = function(type, args) {

     var enabling = args[0];
     var leftImage = args[1];
     if(enabling) {
         leftImage.src = "images/subnav_leftarrow.jpg";
     } else {
         leftImage.src = "images/subnav_leftarrow.jpg";
     }

};

/**
  * Custom button state handler for enabling/disabling button state.
  * Called when the carousel has determined that the next button
  * state should be changed.
  * Specified to the carousel as the configuration
  * parameter: nextButtonStateHandler
  **/
var handleNextButtonState = function(type, args) {

     var enabling = args[0];
     var rightImage = args[1];
     if(enabling) {
         rightImage.src = "images/subnav_rightarrow.jpg";
     } else {
         rightImage.src = "images/subnav_rightarrow.jpg";
     }

};

function completeHandler(type, args) {
     // instead of doing the preview in the loadNext and loadPrev you can
     // wait for the animation scroll to stop before showing the preview
     //preview(this);
}
function preview(carousel) {
     var firstVisible = carousel.getProperty("firstVisible");
     var middle = firstVisible + 2;

     var anchor = YAHOO.util.Dom.get('carousel-anchor-' + middle);
     YAHOO.util.Dom.get('preview').innerHTML = '<img src="' +
anchor.href + '"/>';
}

function spotlight(carousel) {
     var firstVisible = carousel.getProperty("firstVisible");
     var start = firstVisible;
     var revealAmount = carousel.getProperty("revealAmount");
     var size = carousel.getProperty("size");

     if(revealAmount && firstVisible > 1) {
         start = firstVisible - 1;
     }
     var lastVisible = firstVisible +
carousel.getProperty("numVisible") - 1;
     var end = lastVisible;
     if(revealAmount && lastVisible < size) {
         end = lastVisible + 1;
     }

     var middle = firstVisible + 2;

     for(var i=start; i<=end; i++) {
         var li = carousel.getItem(i);

         if(i == middle) {
             YAHOO.util.Dom.replaceClass(li, 'non-spotlight', 'spotlight');
             priorCenterItem = i;
         } else {
             YAHOO.util.Dom.replaceClass(li, 'spotlight', 'non-spotlight');
         }
     }
}

/**
  * You must create the carousel after the page is loaded since it is
  * dependent on an HTML element (in this case 'dhtml-carousel'.) See the
  * HTML code below.
  **/

var carousel; // for ease of debugging; globals generally not a good idea
var pageLoad = function()
{
     carousel = new YAHOO.extension.Carousel("carousel_service",
         {
             numVisible:         5,
             animationSpeed:     0.6,
             animationMethod:    YAHOO.util.Easing.backBoth,
             scrollInc:          1,
             navMargin:          40,
             scrollBeforeAmount: 2,
             firstVisible:       -1,
             size:               5,
             scrollAfterAmount:  2,
             prevElement:        "prev-arrow",
             nextElement:        "next-arrow",
             loadInitHandler:    loadInitialItems,
             loadNextHandler:    loadNextItems,
             loadPrevHandler:    loadPrevItems,
             prevButtonStateHandler:   handlePrevButtonState,
             nextButtonStateHandler:   handleNextButtonState,
             animationCompleteHandler: completeHandler
         }
     );

     //carousel.loadNextHandlerEvt.subscribe(beforeNext, carousel);
};

YAHOO.util.Event.addListener(window, 'load', pageLoad);

HTML:
<div id="carousel_service" class="carousel-component">
     <div class="carousel-clip-region">
         <ul class="carousel-list">
             <!-- Filled in via the loadInitHandler, loadNextHandler,
and loadPrevHandler
             <li id="item-1">
             <a href="#">
                 <img
src="http://static.flickr.com/74/162582364_7fc3e2d60d_s.jpg"/>
             </a>Number One</li>
             -->
         </ul>
     </div>
</div>

#455 From: "angegardienusa" <angegardien@...>
Date: Thu Sep 25, 2008 5:21 pm
Subject: Re: Ajax example
angegardienusa
Offline Offline
Send Email Send Email
 
Well, thank you. Your answer was an excellent pointer and that will
help me accomplish what I am set to do (with the info from firebug, I
am able to see the response clearly. I am able to get it from databse,
but I was not sure on how to present it for reading). So after all, it
paid off to have posted here :-)

I see that you are the developer himself. Thanks also for this
excellent script.

--- In ycarousel@yahoogroups.com, "billwaynescott"
<billwaynescott@...> wrote:
>
> This is outside the topic of the carousel. You are asking a general
programming question
> about how to use ajax, php and your database.
>
> Try this:
> http://www.tizag.com/ajaxTutorial/ajax-mysql-database.php
>
> The getTrips.php is an example file I included. It gets the trips
back from the Trip Planner
> APIs
(http://developer.yahoo.com/travel/tripservice/V1.1/tripSearch.html)
>
> The result is returned as JSON.
>
> You can use Firebug in Firefox (the Net tab, subtab: XHR) to see the
JSON being returned.
> You can also set a breakpoint in the javascript code to look at the
json object returned.
>
> --
> Bill Scott
>
>
> --- In ycarousel@yahoogroups.com, "angegardienusa" <angegardien@> wrote:
> >
> > No one can help me? Please ...
> >
> >
> > --- In ycarousel@yahoogroups.com, "angegardienusa" <angegardien@>
> > wrote:
> > >
> > > Hello, Can someone please point me to the right direction to use
Ajax
> > > with my own database?
> > >
> > > The getTrips.php does not tell me much on how the results is
> > > formatted. I can get URL, Titlle and Image easily from db, but
how do
> > > echo it back? What's in $filecontents?
> > >
> >
>

#454 From: "David Karr" <davidmichaelkarr@...>
Date: Wed Sep 24, 2008 10:49 pm
Subject: Re: Re: Ajax example
davidmichael...
Offline Offline
Send Email Send Email
 
This question has almost nothing to do with the ycarousel component. You should ask these questions on a list with a wider distribution, perhaps comp.lang.javascript.  I can't tell enough from what you've written to tell what the best place would be to ask.  Even if you did post this somewhere else, you'd have to post more detail. I personally have no clue what you're asking.

On Wed, Sep 24, 2008 at 1:38 PM, angegardienusa <angegardien@...> wrote:

No one can help me? Please ...

--- In ycarousel@yahoogroups.com, "angegardienusa" <angegardien@...>
wrote:


>
> Hello, Can someone please point me to the right direction to use Ajax
> with my own database?
>
> The getTrips.php does not tell me much on how the results is
> formatted. I can get URL, Titlle and Image easily from db, but how do
> echo it back? What's in $filecontents?
>



#453 From: "billwaynescott" <billwaynescott@...>
Date: Wed Sep 24, 2008 9:00 pm
Subject: Re: Ajax example
billwaynescott
Offline Offline
Send Email Send Email
 
This is outside the topic of the carousel. You are asking a general programming
question
about how to use ajax, php and your database.

Try this:
http://www.tizag.com/ajaxTutorial/ajax-mysql-database.php

The getTrips.php is an example file I included. It gets the trips back from the
Trip Planner
APIs (http://developer.yahoo.com/travel/tripservice/V1.1/tripSearch.html)

The result is returned as JSON.

You can use Firebug in Firefox (the Net tab, subtab: XHR) to see the JSON being
returned.
You can also set a breakpoint in the javascript code to look at the json object
returned.

--
Bill Scott


--- In ycarousel@yahoogroups.com, "angegardienusa" <angegardien@...> wrote:
>
> No one can help me? Please ...
>
>
> --- In ycarousel@yahoogroups.com, "angegardienusa" <angegardien@>
> wrote:
> >
> > Hello, Can someone please point me to the right direction to use Ajax
> > with my own database?
> >
> > The getTrips.php does not tell me much on how the results is
> > formatted. I can get URL, Titlle and Image easily from db, but how do
> > echo it back? What's in $filecontents?
> >
>

#452 From: "angegardienusa" <angegardien@...>
Date: Wed Sep 24, 2008 8:38 pm
Subject: Re: Ajax example
angegardienusa
Offline Offline
Send Email Send Email
 
No one can help me? Please ...


--- In ycarousel@yahoogroups.com, "angegardienusa" <angegardien@...>
wrote:
>
> Hello, Can someone please point me to the right direction to use Ajax
> with my own database?
>
> The getTrips.php does not tell me much on how the results is
> formatted. I can get URL, Titlle and Image easily from db, but how do
> echo it back? What's in $filecontents?
>

#451 From: "angegardienusa" <angegardien@...>
Date: Tue Sep 23, 2008 1:07 pm
Subject: Ajax example
angegardienusa
Offline Offline
Send Email Send Email
 
Hello, Can someone please point me to the right direction to use Ajax
with my own database?

The getTrips.php does not tell me much on how the results is
formatted. I can get URL, Titlle and Image easily from db, but how do
echo it back? What's in $filecontents?

#450 From: "David Karr" <davidmichaelkarr@...>
Date: Sat Sep 13, 2008 6:55 pm
Subject: Re: What is setting style of ul to left:474px?
davidmichael...
Offline Offline
Send Email Send Email
 
If it matters, I spent some time stepping through the Carousel code. I can see clues to how it ended up in this state, but I can't see the solution. Hopefully if Bill sees this, he will see an important clue.

At the point where I drop the first image on the "empty" carousel, I empty my array and put the first real image on it, and then call "reload(4)" on the carousel.  Stepping through that, it then calls "clear()", then "moveTo()", then "_position()", then "_scrollPrevInc()".

In this last function, I got to the following block:

1425 } else {
1426 var currX = YAHOO.util.Dom.getX(this.carouselList);
1427 YAHOO.util.Dom.setX(this.carouselList, currX +
1428 this.scrollAmountPerInc*dec);
1429 }

I'm on line 1427, where currX = 618.5, this.scrollAmountPerInc = 158, dec = 3.  3*158 = 474, the number that eventually appears as the new "left" value of the "ul". When that number came up, I knew I had a clue (if I could understand it).

The value of newStart = -2 at this point, which seemed curious when I saw it. At the end of this function, it sets:

this._priorFirstVisible = newStart;
1433 this._priorLastVisible = newEnd;

To -2 and 1, respectively. This seems to be consistent with what I see on the screen.  If my first picture is shown in the fourth and last position, that would be index 1, and the "first visible" would be -2, counting backwards.

So I can see some indication of how it got to where it got to, but that's about all I can see at this point.

On Wed, Sep 10, 2008 at 10:38 AM, David Karr <davidmichaelkarr@...> wrote:
I posted about this previously in a couple of places, but I realized the note I wrote in here actually covered an older symptom that I've gotten over.  Otherwise, I've been struggling with this problem for weeks now, with no luck.  The following is a copy of what I wrote to comp.lang.javascript a week ago. I never got any response. I wrote a similar note to the YUI mailing list, also with no response.

I could use some help diagnosing why something in my app or either of the two frameworks I'm using is mysteriously setting the "left" style of a "ul" on my page to 474px (you will very likely see a different, but similar value). I see the exact same behavior on Firefox and IE (although I only rarely test on IE at this point).

For reference, the URL for my test app is at <http://www.rattieworldocomfort.com/carouseltest/mdkcarouseltest2.html>.

The app uses both YUI-2.5.2 and the YUI Carousel 0.6.3.  What you'll see at the URL I've posted is a carousel displaying some thumbnail images.  Below that carousel will be an "empty" carousel (it actually has one "fake" item to convince the carousel to have a reasonable non-collapsed size).

The test case is to drag the first image (any of them will do) from the top carousel onto the bottom carousel. The copied (not moved) image should display itself in the first position of the second carousel. You'll also see the fullsize version of the thumbnail appear below both carousels, but that's unrelated to my problem.

Instead of appearing in the first position, however, it instead appears in the last position (fourth). I imagine this is some unexpected behavior of the Carousel component, but I'm at a loss to understand why it's doing it, and even worse, how.

Under the covers, what I saw was that before the drop, the following element in my HTML looked like this:

<ul class="carousel-list carousel-horizontal" style="position:relative; left: 0px;">
  <li id="favorites-item-1"><div class="fakeimage"/></li>
</ul>

After the drop, it's like this:

<ul class="carousel-list carousel-horizontal" style="position:relative; left: 474px;"><li id="favorites-item-1"><img onmouseover="displayFullSize('photos/IMG_4129web.jpg');" alt="This is a long, long title, going on and on to no particular point" src="photos/tn_IMG_4129web.jpg" class="imageEntry"/>This is a long, long title, going on and on to no particular point</li></ul>

The key here is the change from "left:0px" to "left:474px". I've looked at all the code in YUI and Carousel, and I found the only two places that obviously set the "left" style of ANYTHING, but neither of these are the culprits, as I set breakpoints there, and also modified local copies to add log statements indicating what value it was setting.  Neither of them ever set that value.

If I could figure out how it's setting that value, I might be able to understand why it's doing that, and come to some sort of resolution (it's at this point that I wondered whether Firebug will ever have the ability to "break on particular element changes", and apparently they're already envisioning this feature).

Notice that if you continue dragging other images from the top to the bottom, it seems as if they go nowhere, but if after you drop the other three visible images you then click the right-arrow image, you'll see them scroll into view.

Any reasonable advice you can provide would be useful.

Thanks.


#449 From: "U Robles" <urobles@...>
Date: Sat Sep 13, 2008 12:22 am
Subject: I can't see any items added via Ajax
urobles
Offline Offline
Send Email Send Email
 
Hi,

I am using the carousel to add items from Ajax. If I do it setting a
fixed array of image urls, it works just fine, but when I make an Ajax
request, in the callback method I try to add each of the returned
items in the carousel. The carousel width becomes equal to zero.

	 _renderThumbnailImages: function(mainResultObject)
	 {
		 // Get the start and end indexes & carouselObject from the result
object.
		 var startIndex = mainResultObject.argument.startIndex;
		 var endIndex = mainResultObject.argument.endIndex;
		 var carouselObj = mainResultObject.argument.carouselObj;


// To make this simple, I don't interact with the results from Ajax.
The carousel items are never rendered :(


		 // Add the thumbnail information for each site.
		 for (var itemIndex = startIndex; itemIndex <= endIndex; itemIndex ++) {
			 if (itemIndex >= 1 && itemIndex <= this.totalNumberOfItems) {
				 carouselObj.addItem(itemIndex, "<img src='foo.jpg'");
			 }
		 }

	 }


Has anyone seen this problem?

Thanks,

Ulises.

#448 From: "David Karr" <davidmichaelkarr@...>
Date: Wed Sep 10, 2008 5:38 pm
Subject: What is setting style of ul to left:474px?
davidmichael...
Offline Offline
Send Email Send Email
 
I posted about this previously in a couple of places, but I realized the note I wrote in here actually covered an older symptom that I've gotten over.  Otherwise, I've been struggling with this problem for weeks now, with no luck.  The following is a copy of what I wrote to comp.lang.javascript a week ago. I never got any response. I wrote a similar note to the YUI mailing list, also with no response.

I could use some help diagnosing why something in my app or either of the two frameworks I'm using is mysteriously setting the "left" style of a "ul" on my page to 474px (you will very likely see a different, but similar value). I see the exact same behavior on Firefox and IE (although I only rarely test on IE at this point).

For reference, the URL for my test app is at <http://www.rattieworldocomfort.com/carouseltest/mdkcarouseltest2.html>.

The app uses both YUI-2.5.2 and the YUI Carousel 0.6.3.  What you'll see at the URL I've posted is a carousel displaying some thumbnail images.  Below that carousel will be an "empty" carousel (it actually has one "fake" item to convince the carousel to have a reasonable non-collapsed size).

The test case is to drag the first image (any of them will do) from the top carousel onto the bottom carousel. The copied (not moved) image should display itself in the first position of the second carousel. You'll also see the fullsize version of the thumbnail appear below both carousels, but that's unrelated to my problem.

Instead of appearing in the first position, however, it instead appears in the last position (fourth). I imagine this is some unexpected behavior of the Carousel component, but I'm at a loss to understand why it's doing it, and even worse, how.

Under the covers, what I saw was that before the drop, the following element in my HTML looked like this:

<ul class="carousel-list carousel-horizontal" style="position:relative; left: 0px;">
  <li id="favorites-item-1"><div class="fakeimage"/></li>
</ul>

After the drop, it's like this:

<ul class="carousel-list carousel-horizontal" style="position:relative; left: 474px;"><li id="favorites-item-1"><img onmouseover="displayFullSize('photos/IMG_4129web.jpg');" alt="This is a long, long title, going on and on to no particular point" src="photos/tn_IMG_4129web.jpg" class="imageEntry"/>This is a long, long title, going on and on to no particular point</li></ul>

The key here is the change from "left:0px" to "left:474px". I've looked at all the code in YUI and Carousel, and I found the only two places that obviously set the "left" style of ANYTHING, but neither of these are the culprits, as I set breakpoints there, and also modified local copies to add log statements indicating what value it was setting.  Neither of them ever set that value.

If I could figure out how it's setting that value, I might be able to understand why it's doing that, and come to some sort of resolution (it's at this point that I wondered whether Firebug will ever have the ability to "break on particular element changes", and apparently they're already envisioning this feature).

Notice that if you continue dragging other images from the top to the bottom, it seems as if they go nowhere, but if after you drop the other three visible images you then click the right-arrow image, you'll see them scroll into view.

Any reasonable advice you can provide would be useful.

Thanks.

#445 From: "vikasde2000" <sonukapoor@...>
Date: Tue Sep 9, 2008 5:40 pm
Subject: Re: First 3 items in ajax loading
vikasde2000
Offline Offline
Send Email Send Email
 
I figured what the problem is. I was adding the items wrong.

Instead of doing this:

mycarousel.addItem(index, foo());

I was doing this:

mycarousel.addItem(some_string_var + index, foo());

That solved my problem.

addItem needs the index, and I was passing a string that was something
like "myitem-1".

#444 From: "David Karr" <davidmichaelkarr@...>
Date: Tue Sep 9, 2008 5:36 pm
Subject: Re: First 3 items in ajax loading
davidmichael...
Offline Offline
Send Email Send Email
 
I wonder if you're seeing a symptom that I've been seeing. After you add the items, and before you go to the next page, please use Firebug to inspect the HTML. Look at the "ul" inside the "carousel-clip-region" div. Normally, the "left" style should be "0px". If you're seeing the symptom I'm seeing, it will instead be a couple hundred or so.

On Tue, Sep 9, 2008 at 10:17 AM, vikasde2000 <sonukapoor@...> wrote:

Hi Bill,

I am creating my carousel like this:

carousel = new YAHOO.extension.Carousel("mycarousel",
{
numVisible: 3,
animationSpeed: 0.4,
loadInitHandler: loadInitialItems,
scrollInc: 3,
prevElement: "prev-arrow",
nextElement: "next-arrow",
loadNextHandler: loadNextItems,
loadPrevHandler: loadPrevItems
});

My loadInitialItems function looks like this:
function loadInitialItems(type, args) {
getStyles(_page, _recsPerPage);
}

It gets the data from the database and calls this callback function:

function getStyles_Callback(result, eventArgs) {

for (var i = 0; i < result.length; i++) {
carousel.addItem(_liIdentifier + _lastIndex,
getStyleImage(result[i].Style));
_lastIndex = _lastIndex + 1;
}

}

The problem is now that I can see 3 empty items in the carousel. If I
go to the next page via the carousel buttons, then I can see the
items. I already debugged the function. Any idea why there are 3 empty
items in the beginning?



#443 From: "vikasde2000" <sonukapoor@...>
Date: Tue Sep 9, 2008 5:25 pm
Subject: alreadyCached doesnt work
vikasde2000
Offline Offline
Send Email Send Email
 
Hi,

I am trying to use the loadNextItems and loadPrevItems. Both functions
are called when I click on the links, however the alreadyCached is
always false. How do you set it to true?

#442 From: "vikasde2000" <sonukapoor@...>
Date: Tue Sep 9, 2008 5:17 pm
Subject: First 3 items in ajax loading
vikasde2000
Offline Offline
Send Email Send Email
 
Hi Bill,

I am creating my carousel like this:

carousel = new YAHOO.extension.Carousel("mycarousel",
     {
         numVisible: 3,
         animationSpeed: 0.4,
         loadInitHandler: loadInitialItems,
         scrollInc: 3,
         prevElement: "prev-arrow",
         nextElement: "next-arrow",
         loadNextHandler:   loadNextItems,
         loadPrevHandler:   loadPrevItems
     });

My loadInitialItems function looks like this:
function loadInitialItems(type, args) {
     getStyles(_page, _recsPerPage);
}

It gets the data from the database and calls this callback function:

function getStyles_Callback(result, eventArgs) {

     for (var i = 0; i < result.length; i++) {
         carousel.addItem(_liIdentifier + _lastIndex,
getStyleImage(result[i].Style));
         _lastIndex = _lastIndex + 1;
     }

}

The problem is now that I can see 3 empty items in the carousel. If I
go to the next page via the carousel buttons, then I can see the
items. I already debugged the function. Any idea why there are 3 empty
items in the beginning?

#441 From: "kylelondon85" <kylelondon85@...>
Date: Tue Sep 9, 2008 5:16 pm
Subject: Re: Using two carousels on same page with tabbed layout. How to use show() ??
kylelondon85
Offline Offline
Send Email Send Email
 
wow, i actually got it to work... each of my tab buttons has an ID
already, so i simply added the following lines at the bottom of the
carousel script in the head of the document:

YAHOO.util.Event.addListener("cardsImage", 'click', pageLoad);

and

YAHOO.util.Event.addListener("websitesImage", 'click', pageLoad);

this reloads everything each time one of the two tabs with the
carousels in is clicked on. it may not be the neatest way of doing it
i guess but seems to work without any delay.

thanks again, this is by far the best carousel i found online, i went
through 2 others first and was pulling my hair out! one final thing i
wondered, although not crucial: is there a way to specify the width of
the viewable area of the carousel and eliminiate the numVisible
property? i dont want the width to be based on how many items, but on
the width of my page, as i actually really like the effect of seeing
one item disappearing to the right.

--- In ycarousel@yahoogroups.com, "kylelondon85" <kylelondon85@...> wrote:
>
> Hi, thanks so much for quick help. i don't think i quite understand
> how to use "methods" for the carousel though. if i was to add a
> function to the onclick property of my buttons (e.g.
> onclick="showCarousel();"
>
> what kind of information would i need to put into that function to
> make it work? could it just be the "show()" method? so:
>
> function showCarousel {
> carousel.show();
> }
>
> if that's even half right i'd be impressed since i know nothing at all
> about javascript! :oS
>
>
> --- In ycarousel@yahoogroups.com, "billwaynescott"
> <billwaynescott@> wrote:
> >
> > Having never used Spry I am at a disadvantage to answer.
> >
> > However, a quick search had this discussion about getting the
> onclick event on the tab:
> > http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?
> > forumid=72&catid=602&threadid=1376806&highlight_key=y&keyword1=tabbed
> >
> > You basically want to have an event handler fire when the tab is
> selected and do the show
> > from there.
> >
> > --
> > Bill Scott
> >
> > --- In ycarousel@yahoogroups.com, "kylelondon85" <kylelondon85@>
wrote:
> > >
> > > Hi,
> > >
> > > i have a page that uses Adobe's Spry Tabbed Panels widget to
display 3
> > > different sets of content under 3 tabs. two of those have this
> > > carousel feature running on them. when i load the page,
whichever tab
> > > i have set to be open shows the carousel fine, but when i click to
> > > view the other tab with the other carousel, the carousel doesnt
load.
> > > i know this is because of the Spry javascript setting content to
> > > invisible, and then the carousel not reloading when i choose to
switch
> > > tabs...
> > >
> > > Having looked around i see that i need to call show() somehow to
> > > reload and recalculate the carousel, but i'm at a loss as to where i
> > > need to put show() to make this work. do i somehow integrate it into
> > > the tabbed panel buttons?
> > >
> > > for ease here is the link to the page i'm talking about:
> > >
> > > http://www.createdesigns.co.uk/newsite/showcase.html
> > >
> > > any help would be greatly appreciated!
> > >
> > > Kyle
> > >
> >
>

#440 From: "vikasde2000" <sonukapoor@...>
Date: Tue Sep 9, 2008 5:01 pm
Subject: Re: Ajax
vikasde2000
Offline Offline
Send Email Send Email
 
You are right. There was something messed up with my code.

Thanks for pointing to the example.

#439 From: "vikasde2000" <sonukapoor@...>
Date: Tue Sep 9, 2008 4:54 pm
Subject: Re: Ajax
vikasde2000
Offline Offline
Send Email Send Email
 
Hi Bill,

I understand that it must contain LI items to load static content. I
am trying to load the items via ajax, which works fine, if I include a
static LI into the carousel. If I dont add the static LI, then I cant
even see the dynamic added items.

#438 From: "David Karr" <davidmichaelkarr@...>
Date: Tue Sep 9, 2008 4:49 pm
Subject: Re: Ajax
davidmichael...
Offline Offline
Send Email Send Email
 
I have a similar situation. I have a "loaded" Carousel and an "empty" Carousel, but I want them to be the same size. To get this to work I added a single "invisible" item to the "empty" Carousel. This dummy item is just a div with a class I use to recognize it's a "fake" item. When I later try to add a real item to it, I check to see if there's only one item in it which has the "fake" class, and I proceed to "remove" it (it's not possible to "remove" items individually from the Carousel) before adding the one real item.

On Tue, Sep 9, 2008 at 9:22 AM, vikasde2000 <sonukapoor@...> wrote:

Hi,

This is a great control, however I am having some problems with
implementing the ajax version.

The carousel doesn't seem to work if it doesn't contain any static
items. It needs to have at least one static <li> item to load. Even
your ajax examples contain all one hardcoded <li> item. Is this by
design? Is there a way to get rid of this one item?

Thanks



Messages 438 - 470 of 506   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help