RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-256479

Елизавета Чепцова's questions

Martin Hope
Елизавета Чепцова
Asked: 2020-10-18 06:33:02 +0000 UTC

告诉我如何修复代码,以便所有 h1 悬停时颜色都会发生变化?

  • -1

请告诉我如何修复代码。现在,如果有一个 querySelector,那么脚本可以工作,但只有一个 h1,如果我们将其更改为 getElementsByTagName(),那么脚本将完全停止工作。

var h = document.querySelector('h1');
var p = h.getBoundingClientRect();
var c = document.querySelector('.cursor');

document.body.onmousemove = function(e) {
  /*Adjust the position of the cursor*/
  c.style.left = e.clientX - 50 + 'px';
  c.style.top = e.clientY - 50 + 'px';
  /*Adjust the radial-gradient*/
  h.style.setProperty('--x', (e.clientX - p.top) + 'px');
  h.style.setProperty('--y', (e.clientY - p.left) + 'px');
}
h1 {
  color: #000;
  display: inline-block;
  margin: 50px;
  text-align: center;
  position: relative;
}

h1:before {
  position: absolute;
  content: attr(data-text);
  color: #fff;
  background: #000;
  clip-path: circle(50px at var(--x, -100px) var(--y, -100px));
}

.cursor {
  position: fixed;
  background: #000;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  top: calc(calc(var(--y) * 1px) - 50px);
  left: calc(calc(var(--x) * 1px) - 50px);
  z-index: -2;
}
<h1 data-text="WORK1">WORK1</h1>
<h1 data-text="WORK2">WORK2</h1>
<h1 data-text="WORK">WORK</h1>




<span class="cursor"></span>

代码笔

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Елизавета Чепцова
Asked: 2020-10-13 04:18:30 +0000 UTC

告诉我如何制作这样的跑步线?

  • 8

在此处输入图像描述

请告诉我如何制作一条像图片中那样围绕元素运行的运行线,例如围绕图片。如果可能,从 html 元素设置文本。运行线的圆周运动,在背景中,流变淡了一点,​​它围绕着一些图片运行。谢谢你。

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Елизавета Чепцова
Asked: 2020-07-10 20:50:03 +0000 UTC

Owl Carousel 。幻灯片编号在字段中输入,当您单击按钮时,滑块应切换到此幻灯片

  • 2
    <header>
       <input><button>Start</button> 
        <div class="container">
            <ul>
                <li><a href="#slideshow">Главная</a></li>
                <li><a href="#services">Услуги</a></li>
                <li><a href="#portfolio">Портфолио</a></li>
                <li><a href="#prices">Цены</a></li>
                <li><a href="#contacts">Контакты</a></li>
            </ul>
        </div>
    </header>

           var owl = $('.owl-carousel');
owl.on('initialized.owl.carousel', function() {
  console.log('установлен');
});
        $('.lp-slider2').owlCarousel({
            items: 1,
            nav: true,
            navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'],
            animateOut: 'fadeOut',

       margin:10,
    responsive:{
        0:{
            items:6
        },
        600:{
            items:5
        },            
        960:{
            items:3
        },
        1200:{
            items:1
        }
    }
    }).on('resize.owl.carousel', function() {
  console.log('resized');
}).on('translated.owl.carousel', function() {
  console.log('слайд прееключен');
});

    });
javascript
  • 1 个回答
  • 10 Views
Martin Hope
Елизавета Чепцова
Asked: 2020-07-10 19:21:48 +0000 UTC

告诉我如何使用 owl-carousel 在控制台中显示消息

  • 0

告诉我如何使用 owl-carousel 在发生以下事件时在控制台中显示消息:滑块初始化、滑块切换、滑块大小更改。

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Елизавета Чепцова
Asked: 2020-07-05 19:24:58 +0000 UTC

请帮助重现js中section标签中的data-offset属性

  • 1

通过菜单项,同样校正设置为40px。代码需要改进,以便可以通过data-offset标签属性单独设置此修改section。那些。可以为一个屏幕60px、另一个屏幕20px等设置修正。

(function ($) {
        $(document).ready(function () {
    
          
            function lpHeader() {
                if ($(window).scrollTop() == 0) {        $('header').addClass('top'); 
                } else {
                    $('header.top').removeClass('top'); 
                }
            }
            
            lpHeader(); 
            $(window).on('scroll', lpHeader);
          
            var lpNav = $('header ul');
            
            lpNav.find('li a').on('click', function (e) {
                
                var linkTrgt = $($(this).attr('href'));
                if (linkTrgt.length > 0) { 
                    e.preventDefault(); 
                    var offset = linkTrgt.offset().top; 
                    $('body, html').animate({
                        scrollTop: offset - 40
                    }, 750);
                }
            });
    
           
            function lpSetNavActive() {
                
                var curItem = '';
                
                $('section').each(function () {
                     
                    if ($(window).scrollTop() > $(this).offset().top - 200) {
                        curItem = $(this).attr('id');
                    }
                });
            
          
                if (lpNav.find('li.active a').attr('href') != '#' + curItem || lpNav.find('li.active').length == 0) {
                    
                    lpNav.find('li.active').removeClass('active');
                    
                    lpNav.find('li a[href="#' + curItem + '"]').parent().addClass('active');
                }
            }
            
            lpSetNavActive();
            $(window).on('scroll', lpSetNavActive);
    
        });
    })(jQuery);
header {
        position: fixed;
        top: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.3);
        width: 100%;
        z-index: 100;
    }
    
    header ul {
        padding: 0;
        margin: 0;
        text-align: center;
    }
    
    header ul li {
        display: inline-block;
    }
    
    header ul li a,
    header ul li a:focus {
        display: inline-block;
        padding: 10px 20px;
        color: #fff;
        text-transform: uppercase;
        text-decoration: none;
        transition: color .25s, padding .25s;
    }
    
    header ul li a:hover,
    header ul li.active a {
        color: #337ab7;
        text-decoration: none;
    }
    
    header.top ul li a {
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .lp-content {
        min-height: 500px;
        border: 1px dashed red;
        padding: 40px 0;
    }
    
    .lp-content h2 {
        text-align: center;
        color: #337ab7;
        margin: 0 0 20px 0;
    }
    
    footer {
        background: #337ab7;
        padding: 25px;
    }
    
    footer p {
        text-align: center;
        margin: 0;
        color: #fff;
    }
<!DOCTYPE html>
<html lang="ru">

    <head>
        <meta charset="UTF-8">
        <title>Landing Page</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    </head>
    
    <body>
    
        <header>
            <div class="container">
                <ul>
                    <li><a href="#slideshow">Главная</a></li>
                    <li><a href="#services">Услуги</a></li>
                    <li><a href="#portfolio">Портфолио</a></li>
                    <li><a href="#prices">Цены</a></li>
                    <li><a href="#contacts">Контакты</a></li>
                </ul>
                
            </div>
        </header>
    
        <section id="slideshow" >
            <div class="container">
                <div class="lp-content">
                    <h2>Слайдшоу</h2>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam quos modi omnis deleniti enim labore totam laudantium minus doloremque ab qui, illo aspernatur, sit cum error eum repudiandae tenetur ea.</p>
                </div>
            </div>
        </section>
    
        <section id="services">
            <div class="container">
                <div class="lp-content">
                    <h2>Наши услуги</h2>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam quos modi omnis deleniti enim labore totam laudantium minus doloremque ab qui, illo aspernatur, sit cum error eum repudiandae tenetur ea.</p>
                </div>
            </div>
        </section>
    
        <section id="portfolio" data-offset="20">
            <div class="container">
                <div class="lp-content">
                    <h2>Наши работы</h2>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam quos modi omnis deleniti enim labore totam laudantium minus doloremque ab qui, illo aspernatur, sit cum error eum repudiandae tenetur ea.</p>
                </div>
            </div>
        </section>
    
        <section id="prices">
            <div class="container">
                <div class="lp-content">
                    <h2>Наши цены</h2>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam quos modi omnis deleniti enim labore totam laudantium minus doloremque ab qui, illo aspernatur, sit cum error eum repudiandae tenetur ea.</p>
                </div>
            </div>
        </section>
    
        <section id="contacts">
            <div class="container">
                <div class="lp-content">
                    <h2>Контакты</h2>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam quos modi omnis deleniti enim labore totam laudantium minus doloremque ab qui, illo aspernatur, sit cum error eum repudiandae tenetur ea.</p>
                </div>
            </div>
        </section>
    
        <footer>
            <div class="container">
                <p>© Landing Page 2017</p>
            </div>
    
        </footer>
      
    
    </body>
    
    </html>

javascript
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5