我正在尝试使用最后两个导航按钮(“教育”和“联系人”)将社交媒体图标向左移动,然后停留在那里。
http://comms101.co.za/populus/index.php#
由于某种原因,当点击它时,它会立即显示但是社交媒体图标会恢复原状。 如果再次单击该按钮,则会正确显示(如何显示)。
导航是一个PHP包含。 这是代码:
<div class="row"> <div class="col-lg-5 col-md-5"> <div class="logo"><a href="#"><img src="imgs/logo.png" alt="logo"></a></div> </div> <div class="col-lg-7 col-md-7 mn"> <div class="follow current1" style=""> <a href="#"><img src="imgs/f.png" alt=""></a> <a href="#"><img src="imgs/int.png" alt=""></a> <a href="#"><img src="imgs/in.png" alt=""></a> </div> <div id="menu-icon"> <div class="menu-icn"><span></span><span></span><span></span></div> </div> <div class="menu" id="menu"> <ul id="links"> <li class="link"><a href="index.php">HOME</a></li> <li class="link"><a href="about.php">ABOUT</a></li> <li class="link"><a href="resources.php">RESOURCES</a></li> <li class="link"><a href="training.php">TRAINING</a></li> <li class="link"><a href="coaching.php">COACHING</a></li> <li class="folow current1 current"><a href="education.php">EDUCATION</a></li> <li class="folow1 current2 link"><a href="contact.php">CONTACT</a></li> </ul> </div> </div>I'm trying to get the last two navigation buttons ("Education" and "Contact") to move the social media icons to the left, and then stay there.
http://comms101.co.za/populus/index.php#
For some reason immediately when clicked, it momentarily displays correctly BUT then the social media icons revert back. If you click the button again, then it displays correctly (how it should display).
The navigation is a php include. Here is the code:
<div class="row"> <div class="col-lg-5 col-md-5"> <div class="logo"><a href="#"><img src="imgs/logo.png" alt="logo"></a></div> </div> <div class="col-lg-7 col-md-7 mn"> <div class="follow current1" style=""> <a href="#"><img src="imgs/f.png" alt=""></a> <a href="#"><img src="imgs/int.png" alt=""></a> <a href="#"><img src="imgs/in.png" alt=""></a> </div> <div id="menu-icon"> <div class="menu-icn"><span></span><span></span><span></span></div> </div> <div class="menu" id="menu"> <ul id="links"> <li class="link"><a href="index.php">HOME</a></li> <li class="link"><a href="about.php">ABOUT</a></li> <li class="link"><a href="resources.php">RESOURCES</a></li> <li class="link"><a href="training.php">TRAINING</a></li> <li class="link"><a href="coaching.php">COACHING</a></li> <li class="folow current1 current"><a href="education.php">EDUCATION</a></li> <li class="folow1 current2 link"><a href="contact.php">CONTACT</a></li> </ul> </div> </div>最满意答案
你正在添加一个额外的类来将社交图标移动到一个link2“跟随current1 link2”。 所以当你点击然后jquery添加这个类但在同一时间页面刷新然后“link2”类消失了。 所以你需要的是通过php设置条件,如果页面是联系我们然后将类“link2”添加到此div。
<div class="follow current1 link2"> <a href="#"><img src="imgs/f.png" alt=""></a> <a href="#"><img src="imgs/int.png" alt=""></a> <a href="#"><img src="imgs/in.png" alt=""></a> </div>you are adding an extra class to move social icons to left that one link2 "follow current1 link2". so when you click then jquery add this class but on same time page refresh then "link2" class gone. so what you need is to set the condition through php, if the page is contact us then add class "link2" into this div.
<div class="follow current1 link2"> <a href="#"><img src="imgs/f.png" alt=""></a> <a href="#"><img src="imgs/int.png" alt=""></a> <a href="#"><img src="imgs/in.png" alt=""></a> </div>
更多推荐
发布评论