", "interactionStatistic": {"userInteractionCount": 1, "@type": "InteractionCounter", "interactionType": "https://schema.org/LikeAction"}, "datePublished": "2017-10-14T04:07:50Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/ragnaroks", "@type": "Person", "name": "ragnaroks"}}, {"text": "img 作为子元素占满父元素,不然一直就是一条直线", "datePublished": "2017-10-14T04:08:44Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/ragnaroks", "@type": "Person", "name": "ragnaroks"}}, {"text": "一张图片横切成多张图片,然后 js 脚本一张张延时加载?", "datePublished": "2017-10-14T05:18:15Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/pq", "@type": "Person", "name": "pq"}}, {"text": "@pq #6 大概不是吧,那得切多少张啊。", "datePublished": "2017-10-14T06:59:13Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/Explorare", "@type": "Person", "name": "Explorare"}}, {"text": "图片", "datePublished": "2017-10-14T07:54:28Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/CYKun", "@type": "Person", "name": "CYKun"}}, {"text": "@CYKun #8 传神 www", "datePublished": "2017-10-14T07:57:38Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/Explorare", "@type": "Person", "name": "Explorare"}}, {"text": "CSS3 的 transition 属性可以生成动画,只需要控制初始样式,结束样式,可选的速度曲线", "interactionStatistic": {"userInteractionCount": 1, "@type": "InteractionCounter", "interactionType": "https://schema.org/LikeAction"}, "datePublished": "2017-10-14T08:00:23Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/autoxbc", "@type": "Person", "name": "autoxbc"}}, {"text": "@Explorare 哈哈,误触了\n我的想法是在图片上面放一个空白元素,初始的时候空白元素完全盖住图片,然后用 css 控制空白元素的高度变化,模拟出逐行加载的效果。\n我不懂 css,随口瞎说一下,不可行不要打我", "interactionStatistic": {"userInteractionCount": 1, "@type": "InteractionCounter", "interactionType": "https://schema.org/LikeAction"}, "datePublished": "2017-10-14T08:02:34Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/CYKun", "@type": "Person", "name": "CYKun"}}, {"text": "如果只是简单的线性遮盖 /隐藏, 用不到 JS\nhttps://codepen.io/Caldis/pen/MEqLoW\n一个伪类套一段动画就行, 延时和持续时间都可以自定义", "interactionStatistic": {"userInteractionCount": 2, "@type": "InteractionCounter", "interactionType": "https://schema.org/LikeAction"}, "datePublished": "2017-10-14T09:24:08Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/cbais7890", "@type": "Person", "name": "cbais7890"}}, {"text": "我现在用纸飞机,由于其线路问题,用某些 ISP 上的时候 还能经常碰上图片逐行加载。", "datePublished": "2017-10-14T15:09:02Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/yksoft1", "@type": "Person", "name": "yksoft1"}}, {"text": "@yksoft1 #13 我爱国上网访问亿恒泰的时候基本每张图片都是逐行加载,大概持续 5s,每张图大约 3MB 左右。", "datePublished": "2017-10-14T15:22:58Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/Explorare", "@type": "Person", "name": "Explorare"}}, {"text": "@cbais7890 #12 图片中的小姐姐 叫啥名字 https://ws1.sinaimg.cn/bmiddle/62e721e4gw1et02crv7f5j200k00k0sh.jpg", "datePublished": "2017-10-15T04:44:41Z", "@type": "Comment", "author": {"url": "https://www.v2ex.com/member/fhefh", "@type": "Person", "name": "fhefh"}}], "interactionStatistic": [{"userInteractionCount": 3533, "@type": "InteractionCounter", "interactionType": "https://schema.org/ViewAction"}, {"userInteractionCount": 2, "@type": "InteractionCounter", "interactionType": "https://schema.org/LikeAction"}, {"userInteractionCount": 15, "@type": "InteractionCounter", "interactionType": "https://schema.org/ReplyAction"}], "text": "原来曾经见到过一个 js 脚本,能模拟 56K 拨号上网时因为带宽不足而导致图片逐行加载的脚本,我已经忘记是多久之前看到过的了,也再也找不到了,求助。", "datePublished": "2017-10-14T01:13:06Z", "commentCount": 15, "mainEntityOfPage": "https://www.v2ex.com/t/397512", "author": {"url": "https://www.v2ex.com/member/Explorare", "@type": "Person", "name": "Explorare"}, "headline": "求一个能模拟 '90 拨号宽带的图片逐行扫描效果的 js 脚本", "url": "https://www.v2ex.com/t/397512", "isPartOf": {"url": "https://www.v2ex.com/go/js", "@type": "WebPage", "name": "JavaScript"}, "@context": "https://schema.org", "@type": "DiscussionForumPosting"}
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
Explorare
V2EX  ›  JavaScript

求一个能模拟 '90 拨号宽带的图片逐行扫描效果的 js 脚本

  •  
  •   Explorare · 2017 年 10 月 14 日 · 3533 次点击
    这是一个创建于 3105 天前的主题,其中的信息可能已经有所发展或是发生改变。

    原来曾经见到过一个 js 脚本,能模拟 56K 拨号上网时因为带宽不足而导致图片逐行加载的脚本,我已经忘记是多久之前看到过的了,也再也找不到了,求助。

    15 条回复    2017-10-15 12:44:41 +08:00
    hzw758
        1
    hzw758  
       2017 年 10 月 14 日
    Chrome 开发人员工具里可以模拟呀
    oh
        2
    oh  
       2017 年 10 月 14 日 via iPhone
    Chrome 可以模拟网络环境
    Explorare
        3
    Explorare  
    OP
       2017 年 10 月 14 日
    @hzw758 #1
    @oh #2
    我的意思是我想在网站上部署一个脚本模拟这个效果,让访问者可以看到的。
    ragnaroks
        4
    ragnaroks  
       2017 年 10 月 14 日   ❤️ 1
    <img id="image" src="<src>" style="width:100%;height:0;overflow:hidden;">
    <script>
    let height=1;
    let i=setInterval(()=>{
    document.getelementbyid('image').style.height=height+'%';
    height=(height<=100)?++:height;
    },100);
    </script>
    ragnaroks
        5
    ragnaroks  
       2017 年 10 月 14 日
    img 作为子元素占满父元素,不然一直就是一条直线
    pq
        6
    pq  
       2017 年 10 月 14 日
    一张图片横切成多张图片,然后 js 脚本一张张延时加载?
    Explorare
        7
    Explorare  
    OP
       2017 年 10 月 14 日
    @pq #6 大概不是吧,那得切多少张啊。
    CYKun
        8
    CYKun  
       2017 年 10 月 14 日 via Android
    图片
    Explorare
        9
    Explorare  
    OP
       2017 年 10 月 14 日
    @CYKun #8 传神 www
    autoxbc
        10
    autoxbc  
       2017 年 10 月 14 日   ❤️ 1
    CSS3 的 transition 属性可以生成动画,只需要控制初始样式,结束样式,可选的速度曲线
    CYKun
        11
    CYKun  
       2017 年 10 月 14 日 via Android   ❤️ 1
    @Explorare 哈哈,误触了

    我的想法是在图片上面放一个空白元素,初始的时候空白元素完全盖住图片,然后用 css 控制空白元素的高度变化,模拟出逐行加载的效果。

    我不懂 css,随口瞎说一下,不可行不要打我
    cbais7890
        12
    cbais7890  
       2017 年 10 月 14 日   ❤️ 2
    如果只是简单的线性遮盖 /隐藏, 用不到 JS
    https://codepen.io/Caldis/pen/MEqLoW
    一个伪类套一段动画就行, 延时和持续时间都可以自定义
    yksoft1
        13
    yksoft1  
       2017 年 10 月 14 日
    我现在用纸飞机,由于其线路问题,用某些 ISP 上的时候 还能经常碰上图片逐行加载。
    Explorare
        14
    Explorare  
    OP
       2017 年 10 月 14 日
    @yksoft1 #13 我爱国上网访问亿恒泰的时候基本每张图片都是逐行加载,大概持续 5s,每张图大约 3MB 左右。
    fhefh
        15
    fhefh  
       2017 年 10 月 15 日
    @cbais7890 #12 图片中的小姐姐 叫啥名字
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5484 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 08:11 · PVG 16:11 · LAX 01:11 · JFK 04:11
    ♥ Do have faith in what you're doing.