Hi!

Thanks for your reply!

I understand your trick. But it doesn't seem to work and I don't know
why. I tried to do a document.write('.'+id.substr(1)) and it returns
me the right class.

But all my <img class="myclass"> and <p class="myclass"> remain
visible and nothing happens after a click.

Here's my code:

<div id="textcontent">
<img src="img_src" class="content1"  />
<img src="img_src" class="content2"  />

<ul>
        <li><a href="#content1">Content 1</a></li>
        <li><a href="#content2">Content 2</a></li>
</ul>

<p class="content1">Text...</p>
<p class="content2">Text...</p>
</div>

<script type="text/javascript">
        $("#textcontent").idTabs(function(id,list,set){
           $("a",set).removeClass("selected")
           .filter("[EMAIL PROTECTED]'"+id+"']",set).addClass("selected");
           for(i in list)
                 $(list[i]).hide();
           $('.'+id.substr(1)).fadeIn(2000);
           return false;
         });

</script>

Any idea?

Thanks again!

On 22 sep, 18:39, "Sean Catchpole" <[EMAIL PROTECTED]> wrote:
> Hiya,
>
> You bet, try this:
>
> HTML
> <a href="#myclass">Tab</a>
> <img class="myclass"/>
> <div class="myclass"/>
>
> JAVASCRIPT
> $("#textcontent").idTabs(function(id,list,set){
>    $("a",set).removeClass("selected")
>    .filter("[EMAIL PROTECTED]'"+id+"']",set).addClass("selected");
>    for(i in list)
>      $(list[i]).hide();
>    $('.'+id.substr(1)).fadeIn(2000);
>    return false;
>  });
>
> The '.'+id.substr(1) converts the id into a class.
>
> ~Sean
>
> On 9/19/07, Clément <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I'm using the idTabs plugin.
>
> > I weould like to know if it is possible to have calls on the classes
> > of the elements (example: ".photo", ".text") and not on the elements
> > id's.
>
> > Here's the script I'm using:
>
> >   $("#textcontent").idTabs(function(id,list,set){
> >     $("a",set).removeClass("selected")
> >     .filter("[EMAIL PROTECTED]'"+id+"']",set).addClass("selected");
> >     for(i in list)
> >       $(list[i]).hide();
> >     $(id).fadeIn(2000);
> >     return false;
> >   });
>
> > In fact, I would like to make appear several elements (img, div, etc),
> > by clicking on a link.
>
> > Can someone help me?
>
> > Thanks in advance!

Reply via email to