我想学习一种解包嵌套数组的智能方法.例如,我有一个数组变量$ rma_data ['status'],如下所示;
[status] => Array
(
[0] => Array
(
[created] => 1233062304107
[statusId] => 5
[statusName] => Open
)
[1] => Array
(
[created] => 1233061910603
[statusId] => 2
[statusName] => New
)
[2] => Array
(
[created] => 1233061910603
[statusId] => 1
[statusName] => Created
)
)
Run Code Online (Sandbox Code Playgroud)
我想根据条件将Created timestamps和statusId存储到变量中:如果我们发现存在"Open"状态,我们将使用Open而不是"New"和"Created".如果只有New和Created,我们将使用New.
当前版本的方式:
for($i=0; $i<count($rma_data['status']); $i++)
{
switch($rma_data['status'][$i]['statusId'])
{
case 5:
case 2:
case 3:
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
在弹出窗口期间有没有办法加载CSS?
function kmt_ShowBoxPopup(targetDivID, aTag)
{
var orgin_div_content=document.getElementById(targetDivID).innerHTML;
//alert(targetDivID);
showBoxPopupWin =window.open("",targetDivID,'height=400,width=710,screenX=250,screenY=80, scrollbars=yes');
showBoxPopupWin.document.write ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">'+
'<html><head><title>'+targetDivID+'</title></head><body>'+orgin_div_content+'</body</html>');
if (window.focus) {showBoxPopupWin.focus()}
}
<a class="cs_popuplink" onclick="kmt_ShowBoxPopup('BOX02_01',this); return false; ">show me how..</a>
<div id = "BOX02_01" STYLE=display:none>
p
p
p
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的代码.我想在showBoxPopupwin.document.write函数中加载一个CSS.可能吗?
欢呼,清
我想在我的网站上建立一个圆形的头像.但是,这些clip-path循环适用于Chrome,Safari和IE9.我不知道为什么它不适用于Firefox.我使用的是Firefox 28.0.
我的Chrome浏览器:

火狐:

我的CSS代码:
.author-avatar img{
height: 41px;
left: -18px;
position: relative;
-webkit-clip-path: circle(50%, 50%, 30%);
-moz-clip-path: circle(50%, 50%, 30%);
clip-path: circle(50%, 50%, 30%);
}
Run Code Online (Sandbox Code Playgroud)
是一种让firefox看起来一样的方法吗?