通过追加div失去它的风格

时间:2017-10-13 03:10:02

标签: javascript html twitter-bootstrap division

我想要克隆的部门有一个特定的位置。我如何与我所拥有的其他部门一起追加。

我的div样式代码

ThreadLocal

这里是它的链接 https://screenshots.firefox.com/TAqBN5IIT8atR6lA/localhost

我在上面的代码中呈现的是

<div class="row">
<div class="col-xs-4"></div>
<div class="col-xs-8  verticalLine" id="nestedFeilds"  style=" margin-left: 10px ;float:left; display: none;">

在我的&#34; nestedFeilds&#34;之后不久div结束。我有&#34; showhere&#34; div它只出现在&#34; col-xs-8&#34;行和&#34; col-xs-4&#34;不管用 在追加功能之后它就像这样

https://screenshots.firefox.com/IngUgWgQTJeAjlOC/localhost

附加的jquery函数

<div class= "row" id="2ndmainContainer">
    <div class="col-xs-4"></div>
    <div class="col-xs-8  verticalLine" id="showhere"  style=" margin-left: 10px ;float:left;">
    </div>
</div>

这里是jsfiddle,但这里不起作用 https://jsfiddle.net/r9wtcsj9/

1 个答案:

答案 0 :(得分:1)

希望这会对您有所帮助(全屏查看以查看结果)。您可以看到我为col-md-1列添加了col-md-5label以及$("#addNew, #addNew1").click(function () { if ($("#nestedFeilds").is(":visible")) { $("#showhere").append($("#nestedFeilds").html()); $("#2ndmainContainer").show(); } $("#nestedFeilds").attr('name', 'myid').show(); $("#addNew").hide(); $("#addNew1").show(); });的已删除内联样式所做的更改。其余代码保持不变。

&#13;
&#13;
.verticalLine {
    border-left: thick solid #0accff;
}
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<form>
<label>Your Profile</label>
<div class="row" id="mainContainer">
	<div class="col-md-1 col-xs-4">
		<label for="Education">Education</label>
	</div>
	<div class="col-md-7 col-xs-8 verticalLine" id="nestedFeilds" style=" margin-left: 10px ;float:left; display:none;">
		<a href="" style="color: red;float:right; ">Delete Education</a>
		<input type="text" placeholder="School Name" class="form-control" id="School_Name" required="" name="School_Name">
		<br>
		<input type="text" placeholder="Feild of Study" class="form-control" id="feild_Name" required="" name="feild_Name">
		<br>
		<input type="text" placeholder="Degree" class="form-control" id="Degree_Name" required="" name="Degree_Name">
		<br>
		<div class="row">
			<div class="col-xs-3">
				<select class="form-control" id="YearName" style="float:left;" required="" name="first_year_name" value=''>
				  <option value="2017">2017</option>
			  </select>
			</div>
			<div class="col-xs-3">
				<select class="form-control" style="margin-left: -20px; float:left;" id="monthName" required="" name="first_Name_month" value=''>Select Month
				  <option value='01'>January</option>
			  </select>
			</div>
			<div style="margin-left: -20px;float:left;">
				<p style="text-align: left; margin-top: 5px">&nbsp;to</p>
			</div>
			<div class="col-xs-3">
				<select class="form-control" id="YearName" style="margin-right:30px; float:left;" required="" name="second_year_name" value=''>Select Month
				  <option value="2017">2017</option>
			  </select>
			</div>
			<div class="col-xs-3">
				<select class="form-control" id="monthName" style="float:left; margin-left: -20px;" required="" name="Second__Name_month"
					value=''>Select Month
					  <option value='01'>January</option>
			  </select>
			</div>
		</div>
	</div>
	<div style="float:left;"><a id="addNew"> Add Education</a></div>
</div>

<div class="row" id="2ndmainContainer" style="display:none;">
	<div class="col-md-1 col-xs-4"></div>
	<div class="col-md-7 col-xs-8 verticalLine" id="showhere" style=" margin-left: 10px ;float:left;">
	</div>
</div>

<div style="margin-left: 133px;float:left;"><a id="addNew1" style="display:none;"> Add Education</a></div>
</form>
&#13;
Error Number: 1140

In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'hms.rooms.id'; this is incompatible with sql_mode=only_full_group_by

SELECT `rooms`.*, count(room_no) as total_rooms FROM `rooms` WHERE `room_type_id` = '10'

Filename: D:/Installed_Apps/OpenServer/OpenServer/domains/hms.loc/system/database/DB_driver.php

Line Number: 691
&#13;
&#13;
&#13;