导航按钮保持/移位(Navigation buttons stay / shift)

编程入门 行业动态 更新时间:2024-10-26 06:31:53
导航按钮保持/移位(Navigation buttons stay / shift)

我正在尝试使用最后两个导航按钮(“教育”和“联系人”)将社交媒体图标向左移动,然后停留在那里。

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> 
  
 

更多推荐

本文发布于:2023-08-07 22:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466152.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按钮   Navigation   buttons   stay   shift

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!