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 7701813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:05:01+00:00 2026-05-31T23:05:01+00:00

I am making an algorithm builder and have a main text box on top,

  • 0

I am making an algorithm builder and have a main text box on top, when I click the “+” underneath it, It adds a copy of itself to the next row. If there’s already a row there, it adds it to that row. The problem is I don’t want to just add it to the next row, I want it to be position centered under the one that I pressed the “+” symbol. Someone please take a look at my code and give me some suggestion on how i can fix this. Thank you so much.

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Pathway Builder</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
    <div id="pathway_builder">
        <div class="row" id="row1">
            <div class="whole">
                <div class="centered_box">
                    <textarea class="text_field_not_selected"></textarea>
                </div>
                <input type="button" value="+" class="add_child not_visable" />
            </div>
        </div>
    </div>

    <script src="jQuery.js" type="text/javascript"></script>
    <script src="selectors.js" type="text/javascript"></script>
</body>
</html>

javaScript/jQuery

$('textarea').live('focusin blur', function() {
    $(this).toggleClass('text_field_not_selected');
});

$('.whole').live('mouseenter mouseleave', function() {
    $(this).find('.add_child').toggleClass('not_visable');
});


$(document).ready(function() {
    $('.add_child').live({
        click: function() {
            var new_row = '<div class="row"></div>'
            var new_child = '<div class="whole"><div class="centered_box"><textarea class="text_field_not_selected"></textarea></div><input type="button" value="+" class="add_child not_visable" /></div>'
            if ($(this).parents('.row').next().length == 0) {
                $(this).parents('.row').after(new_row);
                $(this).parents('.row').next().html(new_child).css('position-x', '');
            } else {
                $(this).parents('.row').next().append(new_child);
            }
        }
    });
});

CSS

body {
    margin: 0px;
    padding: 0px;
    text-align: center;
}
textarea {
    width: 4em;
    height: 1em;
    overflow: hidden;
}

textarea:focus {
    outline:  none;
    text-align: center;
    resize: both;
    padding-top: 5px;
    padding-bottom: 5px;
}
.text_field_not_selected {
    text-align: center;
    border-radius: 10px;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    box-shadow: 0px 3px 5px #444;
    -moz-box-shadow: 0px 3px 5px #444;
    -webkit-box-shadow: 0px 3px 5px #444;
    resize: none;
}
.pathway_builder {
    text-align: center;
}
.whole {
    text-align: center;
    display: inline-block;
    background-position-x: 100px;
}
.centered_box {
    padding: 10px;
    padding-bottom: 0px;
}

.add_child {
}

.not_visable {
    visibility: collapse;
}
.row {

}
  • 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-31T23:05:02+00:00Added an answer on May 31, 2026 at 11:05 pm

    Do you want some thing like this;

    Fiddle: http://jsfiddle.net/Td97j/1/

    Demo: http://jsfiddle.net/Td97j/1/embedded/result/

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

Sidebar

Related Questions

Im looking for an algorithm to be used in a racing game Im making.
Making my first steps with NHibernate, I'm trying to have it creating my Tables
The Algorithm traverses a 2D NxN array, making every element the average of its
I am making a program using the LRV(Least recently visited) Algorithm. Basically, I design
I am making a program using the LRV(Least recently visited) Algorithm. Basically, I design
I'm making a vector drawing application. I use this algorithm to generate outlines. This
I would like to store equivalences from Connected-component labeling algorithm . It's basically making
I have an image processing algorithm which makes of matrices, I have my own
I need a help in making an algorithm for solving one problem: There is
I'm making a test on a BFS algorithm on CUDA ( wich I know

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.