简体   繁体   English

如何重定向到带有猫头鹰轮播的其他HTML页面的特定部分

[英]How to redirect toa particular section of a different html page which has owl carouselin it

I want to redirect the user to a particular section of an html page. 我想将用户重定向到html页面的特定部分。

 // javascript for owl $(document).ready(function(){ $('.owl-two').owlCarousel({ loop:true, margin:10, nav:true, autoplay:true, responsive:{ 0:{ items:1 }, 600:{ items:2 }, 1000:{ items:3 } } }); }); 
 <!-- nav--> <ul class="dropdown-menu"> <li><a href="salon_services.php#hair">Hair</a></li> <li><a href="salon_services.php#nail">Nail</a></li> <li><a href="salon_services.php#wax">Wax</a></li> </ul> <!-- owl carousel in salon services page--> <div id="nail" class="row" > <br> <br> <h3 class="text-center">Our Nail Services</h3> <br> <!-- nail carousal--> <div class="owl-two owl-carousel owl-theme"> <div class="item"><img src="images/n1.jpg" alt="Image" class=" img-thumbnail"> <h4 class="text-center">Manicure</h4> </div> <div class="item"><img src="images/n2.jpg" alt="Image" class=" img-thumbnail"> <h4 class="text-center">Pedicure</h4> </div> <div class="item"><img src="images/n3.jpg" alt="Image" class=" img-thumbnail"> <h4 class="text-center">Nail Painting and Design</h4> </div> <div class="item"><img src="images/n4.jpg" alt="Image" class=" img-thumbnail"> <h4 class="text-center">Nail Extensions</h4> </div> </div> 

I want to redirect the user directly from nav dropdown to another page's div containing that content. 我想直接将用户从nav下拉列表重定向到包含该内容的另一个页面的div The page to which I want to redirect has 3 owl carousels. 我要重定向到的页面有3个猫头鹰轮播。

I have already tried the html id redirect. 我已经尝试了html id重定向。 <a href="#id"> , but it does not works completely. <a href="#id"> ,但是它不能完全正常工作。 The page redirects briefly to the section but scrolls automatically to the top of the page. 页面会短暂地重定向到该部分,但会自动滚动到页面顶部。

I am using the owl carousel and think that owl javascript is the responsible factor for this as I have tested it with removing owl and it works, also the id redirect works fine when done from the same page (ieservices page ). 我使用的是owl轮播,并认为owl javascript是造成此问题的原因,因为我已经通过删除owl对其进行了测试,并且它可以正常工作,并且从同一页面(即services page)完成id重定向也可以正常工作。 I have 3 carousels 1.hair 2.nail 3.wax Kindly help I want to keep owl and the section redirect function. 我有3个轮播1.hair 2.nail 3.wax请帮助我保持猫头鹰和分区重定向功能。 Thanks. 谢谢。

 .sec { width: 100%; height: 100vh; background-color: #ccc; margin-bottom: 12px; } 
 <ul> <li><a href="#one">One</a></li> <li><a href="#two">Two</a></li> <li><a href="#three">Three</a></li> <li><a href="#Four">Four</a></li> </ul> <div id="one" class="sec"> <h1>One</h1> </div> <div id="two" class="sec"> <h1>Two</h1> </div> <div id="three" class="sec"> <h1>Three</h1> </div> <div id="four" class="sec"> <h1>Four</h1> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM