Flatsome主题- 全屏文字滚动跑马灯效果

本页面内容可以快速给你的网站添加文字滚动跑马灯效果,可用于网站公告、客户评价、合作伙伴名单等,前提你必须安装了WordPress Flatsome主题。

😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄.😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄

短代码

[ux_html]
[tip_box text="😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄.😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄😄😄😄Discover thousands of easy to customize themes, templates & CMS products。WordPress Themes & Website Templates for any project。An Envato Marketplace。60M+ Items Sold。Fully Responsive Themes。Over 10M Customers。Join the 10M+ Community。😄" animation_duration="135s"]
[/ux_html]

模板函数

// Marquee effect
function tip_box_shortcode($atts) {
    $atts = shortcode_atts(array(
        'text' => '请输入文字',
        'animation_duration' => '10s'
    ), $atts);

    $style = 'style="animation: tipText ' . $atts['animation_duration'] . ' linear infinite;-webkit-animation: tipText ' . $atts['animation_duration'] . ' linear infinite;"';

    $output = '<div class="tipBox"><div class="container"><p class="tipText" ' . $style . '>' . $atts['text'] . '</p></div></div>';

    return $output;
}
add_shortcode('tip_box', 'tip_box_shortcode');

css

/*Marquee effect*/
.tipBox {

    padding: .9rem 0.5rem;
    width: 100%;
    background-color: #044952;
    display: flex;
    align-items: center;
    z-index: 1;
    overflow: hidden;
    }
    .tipText {
      font-size: 16px;
      color: #fff;
      white-space: nowrap;
      width: fit-content;
      animation:tipText 10s linear infinite;
      -webkit-animation:tipText 10s linear infinite;
      padding-bottom: 0;
      margin-bottom: 0;
    }
    .tipText::after{
			position: absolute; 
			right:-100%;
			content:attr(text);
		}
    @-webkit-keyframes tipText {
      0% {
       
        transform: translateX(0);
 
      }
      100% {
        transform: translateX(-100%);
      }
    }

 

可能发生的事

  • 图片不显示

是因为你的网站中没有本页的图片,请重新上传图片替换即可正常显示

如何使用扁平化模块

在您的 Flatsome 网站上使用扩展组件非常简单。
首先,复制提供的短代码并将其粘贴到文本页面编辑器或直接粘贴到 UX Builder。

1. 复制并粘贴短代码

2.添加自定义CSS代码

其次,复制 CSS 代码(如果提供)并将其粘贴到您的项目中以获得所需的样式。在 WordPress 中添加和更新 CSS 代码的方法有多种,所以让我们逐一了解一下。

WordPress 额外 CSS

外观→自定义→额外 CSS

Css Method 2

Flatsome 自定义 CSS

Flatsome →高级→自定义 CSS

20240513130622

Css Method 3

主题样式.css

外观→主题编辑器→ style.css

20240513130736

Css Method 4

 

Open this in UX Builder to add and edit content