|
Posted by Jonathan N. Little on 09/06/07 13:59
ovation wrote:
> On Sep 6, 4:08 am, ovation <i...@ovationfinancial.com> 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 to "Kjell Bublitz" I have a solution. Here it is if anyone
> needs it:
Who is "Kjell Bublitz"? Did you multi-post? Tsk-tsk. GG strikes again.
>
> <a href="javascript:Effect.Combo('file<?php the_ID(); ?>',
> {duration: 0.5});" title="Filed Under"><img src="<?php echo
> bloginfo('template_url'); ?>/images/file.gif" /></a>
>
> <div id="file<?php the_ID(); ?>" style="display: none;">
> <?php echo ''; _e(get_the_category_list(', ')) ?></div>
>
> Thanks to everyone.
>
Funny that "solution" exactly addresses the problem David Dorward
pointed out to you. David: "And you've got this 10 times? IDs must be
unique in a document."
Apparently you either ignored our did not understand the folly of <a
href="javascript:... the JavaScript pseudo-protocol. Reread his link
http://www.jibbering.com/faq/#FAQ4_24
and for the matter for more info:
http://www.google.com/search?hl=en&q=javascript+pseudo+protocol+bad+design&btnG=Search
javascript pseudo protocol bad design - Google Search
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|