Wrap Bootstrap导航栏列出围绕中心品牌形象的项目 [英] Wrap Bootstrap navbar list items around centered brand image

查看:158
本文介绍了Wrap Bootstrap导航栏列出围绕中心品牌形象的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直没有解决这个问题。我使用bootstrap 2.32(对于joomla模板,不支持BS3),我将有动态数量的列表项。我需要的列表项目是中心,但也平均包裹在中心.brand img的左边和右边。我可以把它分成单独的菜单,但什么是有趣的。因此,我首先需要 Bootply 进行测试。

Ive been messing with this all night with no solution. I am using bootstrap 2.32 (for a joomla template, not support BS3 yet), and I will have a dynamic number of list items. I need for the list items to be centered, but also wrapped equally to the left and to the right of a centers .brand img. I could break it up into separate menus, but what would be the fun in that. So I have a Bootply up for testing purposes first. I'm open to any suggestions for accomplishing this.

推荐答案

您可以将图片移动到列表的中心,与后端或javascript:

You could just move the image into the center of the list, either with the backend or with javascript:

<script>
var $nav = $('.nav li');
var $middle = $nav.eq(Math.ceil($nav.length/2));
var $liWrappedImg = $('<li></li>').append($('.brand'));
$middle.before($liWrappedImg);
</script>

这篇关于Wrap Bootstrap导航栏列出围绕中心品牌形象的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆