首页 > 解决方案 > 打开带有外部链接的手风琴常见问题解答内容

问题描述

我在尝试从我们的主页打开特定内容块到用户将单击的特定问题时遇到问题。我希望它自动打开他们在我们的主页上单击的问题,该主页打开了常见问题解答页面。我尝试过使用锚点,它只是将其移至特定问题,但不显示内容。任何帮助,将不胜感激。

    <!-- Begin Accordion Snippet -->
<style>
  .so-tab {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 25px 0;
  }
  .so-tab label {
    position: relative;
    display: block;
    padding: 0 25px 0 0;
    margin-bottom: 15px;
    line-height: normal;
    cursor: pointer;
  }
  .so-tab input {
    position: absolute;
    opacity: 0;
    z-index: -1;
  }
  .so-tab-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s;
  }
  /* :checked */
  .so-tab input:checked ~ .so-tab-content {
    max-height: none;
  }
  /* Icon */
  .so-tab label::after {
    position: absolute;
    right: 0;
    top: 0;
    display: block;
    -webkit-transition: all .35s;
    -o-transition: all .35s;
    transition: all .35s;
  }
  .so-tab input[type=checkbox] + label::after {
    content: "+";
  }
  .so-tab input[type=radio] + label::after {
    content: "\25BC";
  }
  .so-tab input[type=checkbox]:checked + label::after {
    transform: rotate(315deg);
  }
  .so-tab input[type=radio]:checked + label::after {
    transform: rotateX(180deg);
  }
</style>

<h2>Section 1 FAQs</h2>
<div class="so-accordion-wrapper">
  <div class="so-tab">
    <input id="so-tab-1" type="checkbox" name="tabs">
    <label for="so-tab-1">What is the best trail camera that sends pictures to your phone?</label>
    <div class="so-tab-content">
     <a name="q1"> <p>The Browning Defender Pro Scout cameras are our number one-rated cellular trail camera at the moment. You can choose between the Browning Pro Scout AT&amp;T Cellular Trail Camera, or the Browning Pro Scout Verizon Cellular Game Trail Camera. These cellular game trail cameras take excellent photos and get great battery life.</p></a>
    </div>
  </div>
  <div class="so-tab">
    <input id="so-tab-2" type="checkbox" name="tabs">
    <label for="so-tab-2">What is the the best motion activated trail camera?</label>
    <div class="so-tab-content">
      <p><a name="q2">The Browning Patriot Trail Camera has our top-rated score at this time. This trail game camera takes excellent photos, videos, and gets great battery life. If you are looking for the best motion activated trail camera purchase it with Trailcampro today.</a></p>
    </div>
  </div>
  <div class="so-tab">
    <input id="so-tab-3" type="checkbox" name="tabs">
    <label for="so-tab-3">Are wireless trail cameras worth it?</label>
    <div class="so-tab-content">
      <p><a name="q3">Wireless trail cameras give you the ability to receive photos or videos directly to your phone. Getting real time photos of deer and other wildlife to your phone is invaluable. You can also use wireless trail cameras for security applications.</a></p>
    </div>
  </div>
  <div class="so-tab">
    <input id="so-tab-4" type="checkbox" name="tabs">
    <label for="so-tab-4">What is the best cellular trail camera for the money?</label>
    <div class="so-tab-content">
      <p><a name="q4">The best cellular trail camera for the money is the Browning Pro Scout Verizon or the Browning Pro Scour AT&amp;T cellular trail game camera. These cellular cameras are $199.95 and take great photos, get great battery life, and are easy to use.</a></p>
    </div>
  </div>
  <div class="so-tab">
    <input id="so-tab-5" type="checkbox" name="tabs">
    <label for="so-tab-5">What is the difference between a game camera and a trail camera?</label>
    <div class="so-tab-content">
      <p><a name="q5">Wildlife cameras are called by a few different names. Some users call them game cameras, trail cameras, scouting cameras, and wildlife cameras. There is really no difference between a game camera and a trail camera. There are many different models of both and they can be called both a game camera, or a trail camera. Read our trail camera and game camera reviews here at Trailcampro to find the best game or trail camera to fit your needs.</a></p>
    </div>
  </div>
  <div class="so-tab">
    <input id="so-tab-6" type="checkbox" name="tabs">
    <label for="so-tab-6">How high off the ground should a trail camera be?</label>
    <div class="so-tab-content">
      <p><a name="q6">There are many different scenarios for setting up trail cameras. There is not one particular way that it has to be done. However, as a rule of thumb we recommend mounting trail cameras about waist high. This usually works for most settings like placing a game camera on a trail, or maybe watching a feeder.</a></p>
      
    </div>
  </div>

  <div class="so-tab">
    <input id="so-tab-7" type="checkbox" name="tabs">
    <label for="so-tab-7">What is the best trail camera for home security?</label>
    <div class="so-tab-content">
      <p><a name="q7">There are many different trail cameras you can use for security. Some of them will have the ability to send photos to your phone using a cellular connection through Verizon or AT&amp;T. On of our top picks for a cellular security camera is going to be the Ridgetec Lookout. If you are looking for a cellular trail camera for home security one of our top-picks is going to be the here. If you don't have a cellular signal where you are wanting to place the security trail camera. The Reconyx Hyperfire 2 Security may be a good option for you.</a></p>
    </div>
  </div>
  <div class="so-tab">
    <input id="so-tab-8" type="checkbox" name="tabs">
    <label for="so-tab-8">How much does a cellular trail camera plan cost?</label>
    <div class="so-tab-content">
      <p><a name="q8">When choosing a cellular trail camera the cost of the plans can be important. Spypoint seems to offer the best monthly and yearly plans especially if you are wanting an unlimited plan. Most cameras are going to start around $10 a month and that is going to get you a set number of photos per month or a specific amount of data per month. To check out all the cellular cameras and their plans click here and choose which cellular game camera you want to look at.</a></p>
    </div>
  </div>
  <div class="so-tab">
    <input id="so-tab-9" type="checkbox" name="tabs">
    <label for="so-tab-9">How do I view my trail camera pictures on my phone?</label>
    <div class="so-tab-content">
      <p><a name="q9">Almost everyone has a smart phone these days and you can use them to view your trail camera photos. Typically when you have a iPhone the best thing to purchase is going to be an iPhone SD card reader. You would want to purchase one made by Apple as we have seen issues with other brands. If you have an Android device you could use the Stealth Cam 4-IN-1 reader. It seems to work well with Android phones but has issues with iPhones.</a></p>
    </div>
  </div>
  </div>

标签: javascriptaccordion

解决方案


如果您对此使用 JavaScript 没问题,则可以使用<HTMLElement>.click().

如果您在单击 FAQ 位时传递了查询参数(例如?faqclick=specificquestion),则可以使用.click(). 如果您需要有关从客户端获取查询参数的信息,请使用这篇文章:如何获取 HTTP GET 请求传递的客户端参数?

一个例子.click()document.querySelector("#myUniqueQuestion").click()


推荐阅读