我正在創建一個網頁,我將在div中顯示一個表格。我有一個叫做全視圖的按鈕。當我點擊那個按鈕時,只有該div應該顯示在一個新窗口中。所有其他人應該隱藏起來。只有div和它裏面的表格應該顯示。這是我試圖在新窗口中顯示:隱藏導航欄,同時打開新窗口
<?php include("include-this/nav-bar.php"); ?>
<div class="panel panel-default" id="dash_div">
<div class="panel-heading">
Final
<div id="contract_toolbar" name="contract_toolbar" class="btn-group pull-right">
<button id="full_view" name="full_view" type="button" class="btn btn-info btn-sm" onclick="window.open('#dash_div', '_blank')">
Full View
</button>
</div>
</div>
<div class="panel-body">
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table_dashboard" class="table table-striped table-bordered hide">
<thead>
<tr>
<th></th>
<th>Total number</th>
<th>Total Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
var input_report = jQuery("#input_report").val();
//var table_id = "#table_report_" + input_report;
alert(input_report);
jQuery("#table_dashboard").removeClass("hide").addClass("show");
jQuery("#table_dashboard").DataTable({
dom: "<'row'<'col-sm-12'Bftri>>" + "<'row'<'col-sm-4'l><'col-sm-8'p>>",
paging: false,
ajax: "db.php?report=" + input_report,
});
});
我已經包括在第一線的導航欄。當我點擊完整視圖按鈕時,div會在新窗口中與導航欄一起打開。但是,我不想那樣。我只想顯示div。我不知道該怎麼做才能隱藏該導航欄。有人可以告訴我如何在新窗口中打開div時隱藏該內容嗎?
粘貼更多的代碼,我們可以看到你是如何打開新的窗口。如果您在新窗口中添加了某個名稱,則可以引用該窗口中的元素 –
我正在按鈕的onclick函數中打開窗口。檢查按鈕的onclick功能。我在那裏展示過它。 – SSS
我在哪裏可以查看onclick功能?它沒有提供粘貼代碼 –