我正在为我的子页面产品使用TAB导航 - > ?p=products(参见下面的代码,网站是用HTML和PHP实现的)
问题:
例如,用户在第二个TAB中单击链接详细信息.然后他使用后退按钮.现在他回到产品网站,但不是在第二个标签中,而是在第一个标签中.
href="#section-2"如果用户返回产品页面,我想记住上次使用的标签(此处:).
有谁知道我怎么能意识到这一点?
<div id="tabs" class="tabs">
<nav>
<ul>
<li><a href="#section-1" class="icon-cross"><span>Product 1</span></a></li>
<li><a href="#section-2" class="icon-cross"><span>Product 2</span></a></li>
<li><a href="#section-3" class="icon-cross"><span>Product 3</span></a></li>
<li><a href="#section-4" class="icon-cross"><span>Product 4</span></a></li>
</ul>
</nav>
<div class="content">
<section id="section-1">
<div class="tab-heading">
<hr>
<h2 class="intro-text text-center"><strong>Product 1</strong></h2>
<hr>
</div>
...
</section>
<section id="section-2">
<div class="tab-heading">
<hr>
<h2 class="intro-text text-center"><strong>Product 2</strong></h2>
<hr>
</div>
<a href="?p=details">Details</a>
</section>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 数据库架构:
{
_id: "kun2",
result150160: [10,20,30];
moon: 4
}
Run Code Online (Sandbox Code Playgroud)
我想用一个变量删除客户端的整个字段result150160:
var deleteresult = "result150160"
Box.update( {_id: this._id} , {$unset: { deleteresult } } );
Run Code Online (Sandbox Code Playgroud) 是否可以将.htaccess和.htpasswd与流星应用程序一起使用?
如果我在xyz.meteor.com上部署我的应用程序,我可以使用它吗?
我在xyz.meteor.com上尝试过,但它不起作用:
AuthUserFile /meteor/.htpasswd
AuthGroupFile /dev/null
AuthName "Password"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
Run Code Online (Sandbox Code Playgroud) 我有一个网站,其中包含DIV中的iframe.iframe的宽度应取决于浏览器的宽度.
因此我使用JavaScript函数和EventListener来获取浏览器的宽度.这很好.
现在我必须将确定的宽度从JavaScript传递到我的iframe并重新加载它.这是我的HTML/PHP代码与index.html的iframe :
<div id="scout">
<?php
$iframeWidth = "<script>document.write(iframeWidthFromJS)</script>";
echo "iframe width is " . $iframeWidth;
?>
<iframe src="http://cpcms.scout" width="<?php echo $iframeWidth; ?>" height="600"></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的JavaScript,它不起作用:
window.addEventListener('resize', getWindowSize);
window.onload(getWindowSize());
function getWindowSize()
{
var iframeWidthFromJS = 800;
if (typeof (window.innerWidth) == 'number')
{
// Get current browser width
width = window.innerWidth;
iframeWidthFromJS = width;
alert(iframeWidthFromJS);
// Reload the DIV to apply new iframe width
$( "#scout" ).load(window.location.href + " #scout" );
}
}
Run Code Online (Sandbox Code Playgroud)
确定宽度有效,但不会将其传递给iframe.