首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >是否有一种方法可以将achor链接到编码为显示在滚转上的span元素?

是否有一种方法可以将achor链接到编码为显示在滚转上的span元素?
EN

Stack Overflow用户
提问于 2022-11-15 15:02:05
回答 1查看 14关注 0票数 0

我在这里有一个设计,其中有五个span元素,这些元素被设置为在滚动时出现。我的问题是:主菜单将我的元素逐个分解,那么,当有人点击减税策略时,是否有一种方法可以将他们带到页面上,并在页面上显示“税收”元素?就像在可以广告一个或一个id元素吗?

目前,它每次都会加载收入计划,只是好奇是否有可能,所以如果他们点击https://loneb44.sg-host.com/retirement-planning-services/#tax,就会在页面中显示首先显示的税务信息。

在我提交这份报告之前,我到处都查过了。我找不到答案。所以我很感激可能会来的任何帮助。

这是我的代码,它是当前的页面:https://loneb44.sg-host.com/retirement-planning-services/

代码语言:javascript
复制
<section id="approach">
    <div class="containerr">
        <div class="clear"></div>
        <div class="col-lg-06 col-md-6 col-sm-6">
            <div id="approach-diagram" class="retiremet-bg">
                <span class="retirement"></span>
                  <span class="social"></span>
                <span class="legacy"></span>
                <a href="https://loneb44.sg-host.com/retirement-planning-services/#legacy-text"><span class="tax"></span></a>
                 <span class="five"></span>


            </div>
        </div>
        <div class="col-lg-006 col-md-6 col-sm-6">
        
            <div id="retirement-text" class="approach-text" style="display: block" >
                <div class="cavt"> <i class="fas fa-caret-right"></i></div><div>  <h2>Income Planning </h2></div>
                <p>The experienced professionals at Suncrest Advisors will help you decide how much and where to save your income to create the most robust and sustainable retirement income for your future.  This is the foundation of ensuring a comfortable and sustainable lifestyle in retirement.</p>  
<a class="fusion-button button-flat fusion-button-default-size button-custom button-4 fusion-button-span-no fusion-button-default-type options" id="button-1" target="_self" href="#" data-toggle="modal" data-target=".fusion-modal.review" style="margin-top:18px;" id="options"><span class="fusion-button-text">Let's Get Started!</span></a>              
</div>
            <div id="social-text" class="approach-text">
                      <div class="cavt"> <i class="fas fa-caret-right"></i></div><div> <h2>Investment Management</h2></div>
                <p>A reliable investment plan can help secure your retirement. In building and actively managing our client's wealth, we parlay our firm’s stellar research and analysis into having solid long-term conviction around exactly which stock and bonds to own, and why.   </p>  
<a class="fusion-button button-flat fusion-button-default-size button-custom button-4 fusion-button-span-no fusion-button-default-type options"  id="button-1" target="_self" href="#" data-toggle="modal" data-target=".fusion-modal.review" style="margin-top:18px;" id="options"><span class="fusion-button-text">Let's Get Started!</span></a>              
</div>
<div id="legacy-text" class="approach-text">
                     <div class="cavt"> <i class="fas fa-caret-right"></i></div><div> <h2>Tax Reduction Strategies</h2></div>
                <p>When applied appropriately in conjunction with a financial plan, tax planning strategies can help offset the impact of taxes on investment returns and other income.  Our financial planning team can work in conjunction with your other professionals to coordinate the most comprehensive plan for your future.      </p> 
<a class="fusion-button button-flat fusion-button-default-size button-custom button-4 fusion-button-span-no fusion-button-default-type options"  id="button-1" target="_self" href="#" data-toggle="modal" data-target=".fusion-modal.review"  style="margin-top:18px;" id="options"><span class="fusion-button-text">Let's Get Started!</span></a>              
</div>
          
            <div id="tax-text" class="approach-text">
                     <div class="cavt"> <i class="fas fa-caret-right" ></i></div><div> <h2>Long-Term Care Planning</h2></div>
                <p>Long-Term Care Planning aids in planning for life transitions. We work with our clients to make informed decisions regarding how to plan for long-term care expenses and determine the best method of payment, such as: private pay, or Medicaid.  </p>  
<a class="fusion-button button-flat fusion-button-default-size button-custom button-4 fusion-button-span-no fusion-button-default-type options"  id="button-1" target="_self" href="#" data-toggle="modal" data-target=".fusion-modal.review"  style="margin-top:18px;" id="options"><span class="fusion-button-text">Let's Get Started!</span></a>              
</div>
            <div id="five-text" class="approach-text">
                     <div class="cavt"> <i class="fas fa-caret-right" ></i></div><div> <h2>Legacy Planning</h2></div>
                <p>Our careful Legacy Planning can help you pass on much of your hard-earned wealth to your family or your favorite charities without the government’s involvement.  The earlier you explore your options, the better you will be positioned to enhance your legacy.   </p>  
<a class="fusion-button button-flat fusion-button-default-size button-custom button-4 fusion-button-span-no fusion-button-default-type options" id="button-1" target="_self" href="#" data-toggle="modal" data-target=".fusion-modal.review"  style="margin-top:18px;" id="options"><span class="fusion-button-text">Let's Get Started!</span></a>              
</div>

              </div>
        </div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script type="text/javascript">
var parentEl = jQuery('#approach-diagram').attr('class');
jQuery('#approach-diagram span').on('mouseover', function() {
  var hoverEl = jQuery(this).attr('class');
  jQuery('#approach-diagram').attr('class', hoverEl + '-bg');
});

jQuery('#approach-diagram').on('mouseleave', function() {
  jQuery('#approach-diagram').attr('class', parentEl);
});

jQuery('#approach-diagram span').on('mouseenter', function() {
  var clickEl = jQuery(this).attr('class');
  jQuery('#approach-diagram').attr('class', clickEl + '-bg');
  jQuery('.approach-text').slideUp();
  jQuery('#' + clickEl + '-text').slideDown();
  parentEl = clickEl + '-bg';
});
    </script>
</section>
EN

回答 1

Stack Overflow用户

发布于 2022-11-15 15:55:00

请参阅this question/answer,以便使用jQuery从您的URL中提取锚。一旦您有了像'tax'这样的值,就可以再次使用jQuery显示页面的内容。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74447798

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档