Blogger Information
Blog 23
fans 0
comment 1
visits 14016
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
常用的过滤器函数
彪小A的博客
Original
641 people have browsed it
<!DOCTYPE html>
<html lang="en">
<head>
    <script type="text/javascript" src="js/jquery-3.3.1.js"></script>
    <meta charset="UTF-8">
    <title>常用的函数</title>
</head>
<body>
<ul>
    <li>1最新电影<a href="">立即播放</a></li>
    <li>20最新电影<a href="">立即播放</a></li>
    <li>3最新电影<a href="">立即播放</a></li>
    <li>4最新电影<a href="">立即播放</a></li>
    <li>5最新电影<a href="">立即播放</a></li>
    <li>6最新电影<a href="">立即播放</a></li>
    <li>7最新电影<a href="">立即播放</a></li>
    <li>8最新电影<a href="">立即播放</a></li>
    <li>9最新电影<a href="">立即播放</a></li>
    <p>我是另类啊!</p>
    <li>10最新电影<a href="">立即播放</a></li>
</ul>
</body>
<script type="text/javascript">
    // get
    //$('li').get(1).style.color = 'red';
    //eq 选取指定位置的元素
    // $('li').eq(3).css('color','red');
    // 指定位置的后一个 next
    // $('li').eq(3).next().css('color','red');
    // 指定位置的后面全部元素
    // $('li').eq(3).nextAll().css('color','red');
    // 指定位置的前面元素
    // $('li').eq(3).prev().css('color','red');
    // 指定位置的前面全部元素
    // $('li').eq(3).prevAll().css('color','red');
    //去除指定位置的元素不改变,其他位置都改变
    // $('li').eq(3).siblings().css('color','green');
    //获取指定范围的元素slice 不会取到结束位置的元素
 $('li').slice(2,5).css('color','green');
    // 遍历元素
 $('li').each(function () {
       $(this).css('background-color','skyblue');
    })
</script>
</html>


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!