我对按钮不太熟悉,html
所以jquery
如果这是一个重复的问题或者我问错了,请原谅。我想要做的是加载一个tab
外部按钮点击。选项卡的代码如下,
<div id="wrapper">
<div id="content">
<div class="c1">
<div class="controls">
</div>
<div class="tabs">
<div id="tab-1" class="tab">
<article>
<div class="text-section">
<h1>Dashboard</h1>
<p>TVAS data visualizer</p>
</div>
<div style="margin-top: 10px;margin-left: 10px;width: 21%;height: 20px; float: left">
<input type="button" id="btn" name="btn" value="Button" />
<div style="margin-left: 15px; float: left">
Filter :
</div>
<div id='jqxdropdown' style="margin-left: 5px; float: left">
</div>
</div>
<div style="margin-top: 10px;width: 78%;height: 20px; float: right">
<div id='jqxcalendar' style="margin-left: 10px;float: left;"></div>
<div style="margin-left: 10px;float: left;">
<input id="filterButton" type="button" value="Filter"/>
</div>
<div style="margin-left: 10px; float: left">
<font size="1" color="red">
*Filter by ISP only applies to the bar/pie chart
</font>
</div>
</div>
<div id="barChartdiv" style="margin-top: 10px;width:60%; height: 400px;float: left;"></div>
<div id="pieChartDiv" style="margin-top: 10px;width:40%; height: 400px;float: right;"></div>
<div id="linechartdiv" style="width: 100%; height: 500px;float: left;"></div>
</article>
</div>
<div id="tab-2" class="tab">
<article>
<div class="text-section">
<h1>Map view</h1>
<p>TVAS birds eye view</p>
</div>
<div id="google_map_canvas" style="margin-top: 10px;width:1450px; height: 650px;float: left;">
</div>
<div id="over_map">
<input id="outgoingButton" type="button" value="Outgoing"/>
<input id="incomingButton" type="button" value="Incomng"/>
</div>
</article>
</div>
<div id="tab-3" class="tab">
<article>
<div class="text-section">
<h1>Dashboard</h1>
<p>TVAS trend visualizer</p>
</div>
</article>
</div>
</div>
</div>
</div>
<aside id="sidebar">
<strong class="logo"><a href="#">lg</a></strong>
<ul class="tabset buttons">
<li class="active">
<a href="#tab-1" class="ico1"><span>Dashboard</span><em></em></a>
<span class="tooltip"><span>Dashboard</span></span>
</li>
<li>
<a href="#tab-2" class="ico2"><span>Map visualization</span><em></em></a>
<span class="tooltip"><span>Map visualization</span></span>
</li>
<li>
<a href="#tab-3" class="ico3"><span>Trending</span><em></em></a>
<span class="tooltip"><span>Trending</span></span>
</li>
</ul>
<span class="shadow"></span>
</aside>
</div>
此代码当前所做的是,当用户单击必要的侧边栏元素时,它会加载与div
页面左侧对应的侧边栏元素。我需要通过单击按钮jquery
或javascript
位于页面标题区域中的按钮来执行相同操作。
例如像这样的东西,
<script type="text/javascript">
$(document).ready(function () {
$("input[name='btn']").click(function() {
//code to display the contents of a tab
});
});
</script>
任何帮助都会很有帮助:) 我不知道如何让这个问题更清楚。希望它可以理解谢谢:)