Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7050783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:11:10+00:00 2026-05-28T03:11:10+00:00

I am trying to create a working way to show/collapse content that is added

  • 0

I am trying to create a working way to show/collapse content that is added dynamically. I am using rel tags to detect which index and description size that should be shown. I have included my example to make my question easier to understand. However, my solution does not work as it ends up showing the “full” text version only.

Here is the link to my example

http://jsfiddle.net/rowej/z5wTj/15/

or code is below

HTML:

<span id="11_fulltext" rel="11"><p> full text area </p>
  <a href="#" class="switch" rel="big">Toggle</a>
</span>

<span id="11_smalltext" rel="11">
  <p> small text area</p>
  <a href="#" class="switch" rel="small">Toggle</a>
</span>

Jquery (onload):

$(".switch").click(function(e){
  e.preventDefault();
  var index=$(this).closest('span').attr('rel');
  var bigorsmall=$(this).attr('rel');

  alert(index+bigorsmall);
  if(bigorsmall="big"){
    $('#'+index+'_fulltext').hide();
    $('#'+index+'_smalltext').show();    
  }

  if(bigorsmall="small"){
    $('#'+index+'_smalltext').hide();  
    $('#'+index+'_fulltext').show();
  }
});

Is using rel tags like this ok?
Thank you for any help or suggestions!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:11:11+00:00Added an answer on May 28, 2026 at 3:11 am

    Check you code,

    if(bigorsmall="big"){

    Will always be truthy (you are missing an extra = sign)

    if(bigorsmall=="big"){

    same for second part

    if(bigorsmall="small"){ should be if(bigorsmall=="small"){

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a DataGrid dynamically. Declarative creation is working fine: A source
Working with Test::Unit and Shoulda. Trying to test Users.create . My understanding is that
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I am trying to create an image slide show that is similar to this
I'm trying to create a popup for which I am using jQuery's CSS function.Here's
I am trying to create a file in the /tmp directory (working on a
I'm trying to create a piece of code but cannot get it working. The
I'm trying to create a drop down button and its almost working except one
I'm trying to create my own error window for the project I am working
I am working in python on appengine. I am trying to create what is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.