-1

我有一个有趣的问题,过去几天我一直在尝试解决。我创建了第二个导航菜单,并通过将此代码添加到我的 custom_functions.php 将其添加到论文 1.8.5 的侧边栏:

/* Add second menu to sidebar 1*/
register_nav_menu('secondary', 'Secondary Menu');
function secondary_menu() {
wp_nav_menu( array( 'container_class' => 'secondary_menu', 'theme_location' => 'secondary'        ) );
}
add_action('thesis_hook_before_sidebar_1','secondary_menu');

然后,我通过将此 css 添加到 custom.css 来为菜单项创建图标:

/* Menu Container */
.custom .sidebar .menu {
  list-style: none;
  padding: 0;
  margin: 0 0 0 10px;
  width: 190px;
  height: 190px;
  position: relative;
}

/* Submenu Container */
.custom .sidebar .sub-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 190px;
  height: 45px;
  position: relative;
}
/* Facebook */
.custom #menu-item-15470 a {
    display:block;
    height:81px;
    width:80px;
    padding:0px;
    margin-left:0px;
    position: relative;
    left: 0px;
    top: 0px;
    outline:none;
    text-indent:-9999px;
    background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0 0px;
}
.custom #menu-item-15470 a:hover { 
    background-position:-83px 0; 
}

/* Pinterest */
.custom #menu-item-15471 a {
    display:block;
    height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 91px;
top: -81px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -82px;
}
.custom #menu-item-15471 a:hover { 
background-position:-83px -82px; 
}

/* Instagram */
.custom #menu-item-15472 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 0px;
top: -71px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -165px;
}
.custom #menu-item-15472 a:hover { 
background-position:-83px -165px; 
}

/* Instagram Submenu Janae */
.custom #menu-item-15473 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 1px;
top: -72px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -331px;
}
.custom #menu-item-15473 a:hover { 
position: relative;
left: 1px;
top: -72px;
background-position:-83px -331px; 
}

/* Instagram Submenu Billy */
.custom #menu-item-15478 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 1px;
top: -75px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -374px;
}
.custom #menu-item-15478 a:hover { 
background-position:-83px -374px; 
}

/* Twitter */
.custom #menu-item-15475 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 91px;
top: -197px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -248px;
}
.custom #menu-item-15475 a:hover { 
background-position:-83px -248px; 
}

/* Twitter Submenu Janae*/
.custom #menu-item-15476 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 92px;
top: -198px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -417px;
}
.custom #menu-item-15476 a:hover { 
background-position:-83px -417px; 
}

/* Twitter Submenu Billy*/
.custom #menu-item-15479 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 92px;
top: -201px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -460px;
}
.custom #menu-item-15479 a:hover { 
background-position:-83px -460px; 
}

菜单图标在所有浏览器(包括移动 chrome)上正确显示,但在移动 safari(仅显示链接)上不正确。

它应该看起来如何:

http://farm9.staticflickr.com/8220/8340444170_7db7385bab_b.jpg

它在移动 Safari 中的样子:

http://farm9.staticflickr.com/8072/8339388111_7bdc6f50a9_b.jpg

我正在开发的博客是 www.hungryrunnergirl.com,如果您想自己查看的话。

任何帮助,将不胜感激。谢谢

4

1 回答 1

0

它似乎工作正常。我正在使用 iOS Simulator(Apple 官方工具)。我试过 iPhone 和 iPad。您是否遇到缓存问题?

于 2013-01-04T02:39:29.307 回答