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

  • Home
  • SEARCH
  • 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 8650919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:56:11+00:00 2026-06-12T13:56:11+00:00

My jQuery code changes the height of my div from 200px to 100% on

  • 0

My jQuery code changes the height of my div from 200px to 100% on click. This works perfect. But I need to be that when I click it AGAIN, the same element, the div changes back to 200px. I have no idea how to do this except by an if statement but i’m not sure how I would see if a css property matches a certain css property.

Here is my code.

<script>
$(document).ready(function() {

        $("#port1").click(function() {
            $(".ppc").css("height","100%");
        });

    });

</script>
  • 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-06-12T13:56:13+00:00Added an answer on June 12, 2026 at 1:56 pm
    $('#port1').toggle(function () {
        $(".ppc").css({height: "100%"});
    }, function () {
        $(".ppc").css({height: "200px"});
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some jQuery code that highlights a link when clicked, and changes the
My jquery code It's not working when $(a).on(hover,function(){$(this).css(background,#ccc);},function(){$(this).css(background,#fff)}); But is working when $(a).hover(function(){$(this).css(background,#ccc);},function(){$(this).css(background,#fff)}); How
I have this code: <div class=parent> <div class=child>something</div> </div> The parent should be 200px
I have some JQuery code that accesses an iframe on my page and changes
here is small code <div id=clickme> Click here </div> <img id=book src=book.png alt= width=100
We have some JavaScript code that resizes <div/> elements (adjusts height/width/padding/margin etc.) based on
I have a Jquery UI autocomplete code that grabs data from an ajax request,
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I found this jQuery code on a forum: http://jsfiddle.net/nZLpk/8/ However, if I change the
jQuery code add new virtual object .add to object .main $(document).ready(function(){ $('.main').on('click', '.add', function

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.