[英]Twitter Bootstrap: open nav-tabs using script from php
Is it possible to open a nav-tabs using script from a php file( the php file is external ). 是否有可能使用php文件中的脚本打开导航标签( php文件为external )。 I tried using this one
echo "<script>alert('success')open('colors.php#yellow','_self')</script>";
我尝试使用这一
echo "<script>alert('success')open('colors.php#yellow','_self')</script>";
to direct to the page where it will open a nav-tab with an ID of yellow 定向到将在其中打开ID为黄色的导航标签的页面
i have this HTML 我有这个HTML
<div class="container">
<!-------->
<div id="content">
<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
<li class="active"><a href="#red" data-toggle="tab">Red</a></li>
<li><a href="#orange" data-toggle="tab">Orange</a></li>
<li><a href="#yellow" data-toggle="tab">Yellow</a></li>
<li><a href="#green" data-toggle="tab">Green</a></li>
<li><a href="#blue" data-toggle="tab">Blue</a></li>
</ul>
<div id="my-tab-content" class="tab-content">
<div class="tab-pane active" id="red">
<h1>Red</h1>
<p>red red red red red red</p>
</div>
<div class="tab-pane" id="orange">
<h1>Orange</h1>
<p>orange orange orange orange orange</p>
</div>
<div class="tab-pane" id="yellow">
<h1>Yellow</h1>
<p>yellow yellow yellow yellow yellow</p>
</div>
<div class="tab-pane" id="green">
<h1>Green</h1>
<p>green green green green green</p>
</div>
<div class="tab-pane" id="blue">
<h1>Blue</h1>
<p>blue blue blue blue blue</p>
</div>
</div>
</div>
PHP open_color.php PHP的 open_color.php
echo "<script>alert('success')open('colors.php#yellow','_self')</script>"
my output is still the red tab will be opened as active 我的输出仍然是红色选项卡将被打开为活动状态
What about this one: 这个如何:
open_color.php: open_color.php:
$val = $_REQUEST['some_var'];
switch ($val) {
case 'red':
header("Location: colors.php#red");
break;
. . .
default:
header("Location: colors.php");
break;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.