【问题标题】:Display tooltip when hovering over paypal button?将鼠标悬停在贝宝按钮上时显示工具提示?
【发布时间】:2022-01-03 22:01:17
【问题描述】:

我尝试在代码周围的<div> 中使用alt 和title 属性,但它似乎不起作用。 ????

我想让潜在买家对价格有一些保证,而无需登录贝宝甚至点击按钮。肯定有办法让它发挥作用吗?不过,它必须是官方浏览器工具提示,因为它必须值得信赖。

这是目前的标准贝宝代码:

    <div id="smart-button-container">
      <div style="text-align: center;">
        <div id="paypal-button-container"></div>
      </div>
    </div>
  <script src="https://www.paypal.com/sdk/js?client-id=clientID&enable-funding=venmo&currency=AUD" data-sdk-integration-source="button-factory"></script>
  <script>
    function initPayPalButton() {
      paypal.Buttons({
        style: {
          shape: 'pill',
          color: 'silver',
          layout: 'horizontal',
          label: 'paypal',
          
        },

        createOrder: function(data, actions) {
          return actions.order.create({
            purchase_units: [{"description":"test","amount":{"currency_code":"AUD","value":100}}]
          });
        },

        onApprove: function(data, actions) {
          return actions.order.capture().then(function(orderData) {
            
            // Full available details
            console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));

            // Show a success message within this page, e.g.
            const element = document.getElementById('paypal-button-container');
            element.innerHTML = '';
            element.innerHTML = '<h3>Thank you for your payment!</h3>';

            // Or go to another URL:  actions.redirect('thank_you.html');
            
          });
        },

        onError: function(err) {
          console.log(err);
        }
      }).render('#paypal-button-container');
    }
    initPayPalButton();
  </script>

【问题讨论】:

    标签: button paypal tooltip title alt


    【解决方案1】:

    我想让潜在买家对价格有一些保证,而无需登录贝宝甚至点击按钮。

    唯一的解决方案是在 DOM 元素中显示价格/描述 (单独的&lt;div&gt; 或类似的)在贝宝按钮容器旁边。

    所以,类似:

        <div id="smart-button-container">
          <div style="text-align: center;">
            <h2>Test A$100</h2>
            <div id="paypal-button-container"></div>
          </div>
        </div>
    

    或者任何适合您页面的样式和位置。

    【讨论】:

    • 你确定没有办法做到这一点吗?这不是未知数的情况吗??
    • 对贝宝按钮容器的内容不做任何保证,并且随时可能更改。您可以/应该只在该容器之外插入您自己的附加内容。
    • 可以吗?应该?如果有办法做到这一点,我想知道。那是我支付的服务器上的
      。贝宝正在获得我的佣金。我想这样做是为了消除歧义,而不是为了欺骗别人。
    • 查看您应该做什么的答案。
    • 但我不想以 h2(或任何其他 h)显示价格。如果我想要,我会要求它。?这将完全破坏它的美学设计方面。?
    猜你喜欢
    相关资源
    最近更新 更多
    热门标签