使用Sass进行导航.我正在尝试使用:最后一个子选择器为最后一个菜单链接应用不同的链接颜色(红色)但没有成功.任何人都可以告诉我如何从以下Sass代码实现?下面是我到目前为止的代码.任何建议将不胜感激!
HTML
<ul class="menu">
<li>
My Navigation
</li>
<li>
<a href="#">First Link</a>
</li>
<li>
<a href="#">Second Link</a>
</li>
<li>
<a href="#">Third Link</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
萨斯
.menu {
@include inline-list;
font-size: 13px;
&, a {
color: black;
text-decoration: none;
}
> * + * {
margin-left: .5em;
+ *:before {
content: ">";
margin-right: .5em;
}
}
& a ul li:last-child {
color: red;
font-weight: bold;
}
}
Run Code Online (Sandbox Code Playgroud) 我正在为DotNetNuke的DDR Treeview菜单工作,只显示所选的Root项及其要扩展的子节点.这是我想要实现的目标.(左垂直菜单)有什么建议吗?

这是xslt代码,目前显示所有根项.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:param name="ControlID" />
<xsl:param name="Options" />
<xsl:template match="/*">
<xsl:apply-templates select="root" />
</xsl:template>
<xsl:template match="root">
<xsl:if test="node">
<ul class="treeview filetree" id="{$ControlID}">
<xsl:apply-templates select="node" />
</ul>
<script type="text/javascript">
jQuery(function($) {
$("#<xsl:value-of select="$ControlID" />").treeview(
<xsl:value-of select="$Options" disable-output-escaping="yes" />
);
});
</script>
</xsl:if>
</xsl:template>
<xsl:template match="node">
<li>
<xsl:if test="node and (@depth != 0 or @breadcrumb = 1)">
<xsl:attribute name="class">open</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="@enabled = 0">
<xsl:value-of select="@text" />
</xsl:when>
<xsl:otherwise>
<a href="{@url}">
<xsl:choose> …Run Code Online (Sandbox Code Playgroud) 嗨,我正在尝试在一个活动中创建多个上下文菜单.有两个按钮,我想为每个按钮创建不同的上下文菜单.有人可以建议我或推荐我一些有用的例子吗?
这是我目前的代码.
registerForContextMenu(btn_1);
registerForContextMenu(btn_2);
btn_1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
openContextMenu(v);
}
});
btn_2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
openContextMenu(v);
}
});
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
getMenuInflater().inflate(R.menu.media_menu, menu);
menu.setHeaderTitle("Context menu for btn_1");
menu.setHeaderIcon(R.drawable.icon_media_up);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.photo:
Toast.makeText(this, "One", Toast.LENGTH_SHORT).show();
return true;
case R.id.video:
Toast.makeText(this, "Two", Toast.LENGTH_SHORT).show();
return true;
case R.id.audio:
Toast.makeText(this, "Three", Toast.LENGTH_SHORT).show();
return true;
}
return super.onContextItemSelected(item);
}
Run Code Online (Sandbox Code Playgroud) 我不确定我做错了什么但是在为#content应用背景颜色时遇到了麻烦.但是如果我将高度值设置为800px就行了.但我希望它是自动或100%,因为这个模板将在整个网站中使用.任何建议将不胜感激.
<div class="content_bg">
<div id="content">
<div id="contentLeft">
</div>
<div id="contentRight">
<div id="ContentPane" runat="server" />
</div>
</div>
</div>
<div class="footer_bg">
<div id="footer">
<div id="footerLeft">
</div>
<div id="footerRight">
</div>
</div>
</div>
/*
====================================================================
Content Area
====================================================================
*/
.content_bg
{
background:#dadad9 url(images/interior_content_bg_top.jpg) repeat-x center top;
overflow:hidden;
}
#content
{
width:980px;
margin:auto;
height:auto;
background:#fff;
}
#contentLeft
{
float:left;
width:209px;
margin-top:50px;
}
#contentRight
{
float:right;
width:770px;
margin:20px 0 0 0;
}
/*
====================================================================
Footer
====================================================================
*/
.footer_bg
{
background:#dadad9 url(images/interior_footer_bg.jpg) repeat-x center top;
clear:both;
} …Run Code Online (Sandbox Code Playgroud) 嗨,我正在使用ImageButton点击活动,但它无法完成当前活动.
btn_home.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent i = new Intent(getApplicationContext(), GridActivity.class);
i.putExtra("feed", _rssFeed);
startActivity(i);
SwipeDetailView.this.finish();
}
});
Run Code Online (Sandbox Code Playgroud)
但是,如果我单击同一类中操作栏菜单上的主页按钮,它会正常关闭.
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试通过发出HTTP请求更新Android中的MySQL数据,但它给了我一个错误
"类型不匹配:无法从org.apache.http.HttpResponse转换为com.google.api.client.http.HttpResponse"
在这行代码"httpClient.execute(httpPost)"
HttpResponse response = httpClient.execute(httpPost);
Run Code Online (Sandbox Code Playgroud)
它通过添加org.apache.http来提供快速修复的选项
org.apache.http.HttpResponse response = httpClient.execute(httpPost);
Run Code Online (Sandbox Code Playgroud)
有人能告诉我这里我做错了什么吗?非常感谢!
protected String doInBackground(String... params) {
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://---.com/---/approve_request.php");
List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>();
nameValuePair.add(new BasicNameValuePair("status", "Approved"));
try {
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
org.apache.http.HttpResponse response = httpClient.execute(httpPost);
Log.d("Http Response:", response.toString());
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
Run Code Online (Sandbox Code Playgroud) android ×3
css ×2
asp.net ×1
compass-sass ×1
css3 ×1
dotnetnuke ×1
html5 ×1
httprequest ×1
java ×1
sass ×1
treeview ×1
xml ×1
xslt ×1