I want to use javascript to display the categories that the post is filed under when a icon/image is clicked. The list of categories should expand at the bottom of the post under the icon(s). This works great on the single post page, but the index (main) page lists 10 posts, and it will only work on the first post. No matter what post icon is clicked the first post expands. I think I understand the logic behind this, but is there any way around it? Here is the code: <a href="javascript:Effect.Combo(''file'', {duration: 0.5});" title="Filed Under"><img src="<?php echo bloginfo(''template_url''); ?>/ images/file.gif" /></a> <div id="file" style="display: none;"> <?php echo ''''; _e(get_the_category_list('', '')) ?></div> Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hello That''s because you go by ID to apply the effect. If you generate 10 times always the same ID on a single page (such as index) only the very first one is used by JS and the Browser.. So what you have to do is to generate a unique ID for the elements. In terms of Wordpress you need to write the id and link like so: <div id="file<?php the_ID(); ?>"></div> <a href="javascript:Effect.Combo(''file<?php the_ID(); ?>'', {duration: 0.5});"> ... regards, Kjell On 9/6/07, ovation <info-xAEbhp4rIXaGGiaOOsIlZVaTQe2KTcn/@public.gmane.org> wrote:> > I want to use javascript to display the categories that the post is > filed under when a icon/image is clicked. The list of categories > should expand at the bottom of the post under the icon(s). > > This works great on the single post page, but the index (main) page > lists 10 posts, and it will only work on the first post. No matter > what post icon is clicked the first post expands. I think I > understand the logic behind this, but is there any way around it? > > Here is the code: > > <a href="javascript:Effect.Combo(''file'', {duration: 0.5});" > title="Filed Under"><img src="<?php echo bloginfo(''template_url''); ?>/ > images/file.gif" /></a> > > <div id="file" style="display: none;"> > <?php echo ''''; _e(get_the_category_list('', '')) ?></div> > > Thanks > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Where the @#$! do I send the check!!!!!!!!!!!!!!!!!!!!! :-) THAT IS GREAT!!!! This will help keep the blog very minimal. I hate all those categories, social bookmarks, etc. at the bottom of posts. Thanks again! On Sep 6, 6:32 am, "Kjell Bublitz" <m3nt0r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello > > That''s because you go by ID to apply the effect. If you generate 10 > times always the same ID on a single page (such as index) only the > very first one is used by JS and the Browser.. > > So what you have to do is to generate a unique ID for the elements. > > In terms of Wordpress you need to write the id and link like so: > > <div id="file<?php the_ID(); ?>"></div> > > <a href="javascript:Effect.Combo(''file<?php the_ID(); ?>'', {duration: > 0.5});"> ... > > regards, > Kjell > > On 9/6/07, ovation <i...-xAEbhp4rIXaGGiaOOsIlZVaTQe2KTcn/@public.gmane.org> wrote: > > > > > I want to use javascript to display the categories that the post is > > filed under when a icon/image is clicked. The list of categories > > should expand at the bottom of the post under the icon(s). > > > This works great on the single post page, but the index (main) page > > lists 10 posts, and it will only work on the first post. No matter > > what post icon is clicked the first post expands. I think I > > understand the logic behind this, but is there any way around it? > > > Here is the code: > > > <a href="javascript:Effect.Combo(''file'', {duration: 0.5});" > > title="Filed Under"><img src="<?php echo bloginfo(''template_url''); ?>/ > > images/file.gif" /></a> > > > <div id="file" style="display: none;"> > > <?php echo ''''; _e(get_the_category_list('', '')) ?></div> > > > Thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---