尝试获得不透明度来切换.基本上,列表项设置为零不透明度,从而保持其高度.单击列表子类别头时,空列表区域将下拉列表项的深度,然后不透明度应切换以显示列表元素.再次单击子类别列表头时,列表项的不透明度将逐渐变为零,然后列表区域将折叠.需要将列表项保留在那里,因此不透明度方法而不是隐藏,hideToggle或从DOM中删除它们的类似函数. http://jsfiddle.net/hotdiggity/zn6cz/10/
<!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>jQuery Toggle Opacity</title>
<script type="text" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
</head>
<body>
<ul class="list">
<li><a href="#">Subcategory</a></li>
<li id="id-1" class="expandable"><a href="#">Subcategory - Click this one</a>
<ul>
<li>Sub menu item 1</li>
<li>Sub menu item 2</li>
<li>Sub menu item 3</li>
<li>Sub menu item 4</li>
<li>Sub menu item 5</li>
<li>Sub menu item 6</li>
</ul></li>
<li><a href="#">Subcategory</a></li>
<li><a href="#">Subcategory</a></li>
</ul>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
JQuery的...
?$(document).ready(function(){
$('.list li.expandable ul').hide();
$('.list li.expandable ul li').css({ …Run Code Online (Sandbox Code Playgroud) 尝试在local.xml文件中使用two_column_right模板让主页显示4列网格以显示项目.不幸的是,我正在为其他地方的目录页面指定三列网格:/
可能需要<update handle="four_column_grid" />在引用主页的标签下插入?
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<four_column_grid>
<reference name="product_list">
<action method="setColumnCount">
<count>4</count>
</action>
</reference>
</four_column_grid>
<three_column_grid>
<reference name="product_list">
<action method="setColumnCount">
<count>3</count>
</action>
</reference>
</three_column_grid>
<default>
<!-- Header -->
<reference name="header">
<action method="unsetChild"><name>welcome</name></action>
</reference>
<!-- Root -->
<reference name="root">
<action method="unsetChild"><name>breadcrumbs</name></action>
</reference>
<reference name="footer">
<!-- Remove all the other Magento links - "Site Map, Search Terms, Advanced Search, and Contact Us" -->
<!-- <action method="unsetChild"><name>footer_links</name></action> -->
</reference>
<!-- Right sidebar -->
<reference name="right">
<remove name="paypal.partner.right.logo"/>
</reference> …Run Code Online (Sandbox Code Playgroud)