有一个javascript文件 protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//write you code here
}
}
:
jquery.dropdownPlain.js
如何将附加字符“»”放置在其容器的右侧?
编辑:
HTML:
$(function(){
$("ul.dropdown li").hover(function(){
$(this).addClass("hover");
$('ul:first',this).css('visibility', 'visible');
}, function(){
$(this).removeClass("hover");
$('ul:first',this).css('visibility', 'hidden');
});
$("ul.dropdown li ul li:has(ul)").find("a:first").append(" » "); // how to make this appended character to be placed at the right of its container ?
});
css:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Simply Styled jQuery Dropdown</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection"/>
<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.dropdownPlain.js"></script>
</head>
<body>
<div>
<ul class="dropdown">
<li class="menuppal"><a href="#">Administration</a>
<ul>
<li><a href="#">Artificial Turf</a></li>
<li>
<a href="#">Batting Cages</a>
<ul>
<li><a href="#">Indoor</a>
<ul>
<li><a href="#">Garden</a></li>
</ul>
</li>
<li><a href="#">Outdoor</a></li>
</ul>
</li>
<li><a href="#">Benches & Bleachers</a></li>
<li><a href="#">Communication Devices</a></li>
<li><a href="#">Dugouts</a></li>
<li><a href="#">Fencing & Windscreen</a></li>
<li><a href="#">Floor Protectors</a></li>
<li><a href="#">Foul Poles</a></li>
<li><a href="#">Netting</a></li>
<li><a href="#">Outdoor Furniture</a></li>
<li><a href="#">Outdoor Signs</a></li>
<li><a href="#">Padding</a></li>
<li><a href="#">Scoreboards</a></li>
<li><a href="#">Shade Structures</a></li>
<li><a href="#"> - VIEW ALL - </a></li>
</ul>
</li>
<li class="menuppal"><a href="#">Structure</a>
<ul>
<li><a href="#">All-in-One Team Cart</a></li>
<li><a href="#">Air & Electrical Reels</a></li>
<li><a href="#">Field Drags</a></li>
<li>
<a href="#">Field Marking Equipment</a>
<ul>
<li><a href="#">Batter's Box Templates</a></li>
<li><a href="#">Dryline Markers</a></li>
<li><a href="#">Field Paint</a></li>
<li><a href="#">Field Sprayers</a></li>
<li><a href="#">Stencils</a></li>
</ul>
</li>
<li>
<a href="#">Field Tarps</a>
<ul>
<li><a href="#">Area Tarps</a></li>
<li><a href="#">Growth Covers / Protectors</a></li>
<li><a href="#">Infield Tarps</a></li>
<li><a href="#">Tarp Accessories</a></li>
</ul>
</li>
<li><a href="#">Hand Tools</a></li>
<li>
<a href="#">Irrigation, Hoses, Nozzles</a>
<ul>
<li><a href="#">Hoses & Hose Reels</a></li>
<li><a href="#">Irrigation</a></li>
<li><a href="#">Nozzles</a></li>
</ul>
</li>
<li><a href="#">Layout Tools</a></li>
<li><a href="#">Moisture Removal</a></li>
<li><a href="#">Mound Fortification</a></li>
<li><a href="#">Mowers & Stripers</a></li>
<li><a href="#">Soil Management</a></li>
<li><a href="#">Soil Amendments</a></li>
<li><a href="#">Spreaders & Sweepers</a></li>
<li><a href="#"> - VIEW ALL - </a></li>
</ul>
</li>
<li class="menuppal"><a href="#">Exercice</a>
<ul>
<li>
<a href="#">Baseball - Softball</a>
<ul>
<li><a href="#">Base Accessories</a></li>
<li><a href="#">Bases & Home Plates</a></li>
<li><a href="#">Game Accessories</a></li>
<li><a href="#">Pitching Rubbers</a></li>
</ul>
</li>
<li>
<a href="#">Batting Practice Equipment</a>
<ul>
<li><a href="#">Backstops</a></li>
<li><a href="#">Infield Screens</a></li>
<li><a href="#">Jugs Pitching Machines</a></li>
<li><a href="#">Turf Mats</a></li>
<li><a href="#">Turf Protectors</a></li>
<li><a href="#">Replacement Accessories</a></li>
</ul>
</li>
<li>
<a href="#">Batting Cages</a>
<ul>
<li><a href="#">Indoor</a></li>
<li><a href="#">Outdoor</a></li>
</ul>
</li>
<li>
<a href="#">Portable Mounds</a>
<ul>
<li><a href="#">Batting Practice Mounds</a></li>
<li><a href="#">Game Mounds</a></li>
<li><a href="#">Practice Mounds</a></li>
</ul>
</li>
<li>
<a href="#">Football</a>
<ul>
<li><a href="#">First Down Markers</a></li>
<li><a href="#">Football Accessories</a></li>
<li><a href="#">Football Goalposts</a></li>
</ul>
</li>
<li>
<a href="#">Soccer</a>
<ul>
<li><a href="#">Soccer Goals</a></li>
<li><a href="#">Soccer Accessories</a></li>
</ul>
</li>
<li><a href="#"> - VIEW ALL - </a></li>
</ul>
</li>
<li class="menuppal"><a href="#">Contribuables et biens</a>
<ul>
<li><a href="#">Ladders & Sticks</a></li>
<li><a href="#">Hurdles</a></li>
<li><a href="#">Training Accessories</a></li>
<li><a href="#">Smart-Cart Training System</a></li>
<li><a href="#">Smart-Hurdle Collection</a></li>
<li><a href="#"> - VIEW ALL - </a></li>
</ul>
</li>
<li class="menuppal"><a href="#">Recettes</a>
<ul>
<li><a href="#">Field Design</a></li>
<li><a href="#">Turf Management</a></li>
<li><a href="#">Training</a></li>
<li><a href="#"> - VIEW ALL - </a></li>
</ul>
</li>
<li class="menuppal"><a href="#">Edition</a>
<ul>
<li><a href="#">Field Design</a></li>
<li><a href="#">Turf Management</a></li>
<li><a href="#">Training</a></li>
<li><a href="#"> - VIEW ALL - </a></li>
</ul>
</li>
<li class="menuppal"><a href="#">Outils</a>
<ul>
<li><a href="#">Field Design</a></li>
<li><a href="#">Turf Management</a></li>
<li><a href="#">Training</a></li>
<li><a href="#"> - VIEW ALL - </a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>
答案 0 :(得分:3)
试试这个,只需向右浮动添加span: -
$("ul.dropdown li ul li:has(ul)").find("a:first").append("<span style='float:right'> »</span>< ");
答案 1 :(得分:1)
只需在右侧添加文字对齐,就像这样......
ul {
list-style: none;
text-align: right;
}
检查这个小提琴 - &gt; https://fiddle.jshell.net/y3c916hh/3/
答案 2 :(得分:0)
你需要把#34;&#34;在一个单独的元素中对齐它。
$("ul.dropdown li ul li:has(ul)").find("a:first").append( "<span class='more-pointer' >»</span>" );
并使用css类
.more-pointer{
position: absolute;
right: 4px;
top: 6px;
}
更新代码位于以下位置