V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
Gladoos
V2EX  ›  JavaScript

WordPress js 求助

  •  
  •   Gladoos · 2018-11-05 19:01:01 +08:00 · 3423 次点击
    这是一个创建于 1971 天前的主题,其中的信息可能已经有所发展或是发生改变。

    模仿别人弄了一个鼠标点击心形特效 别人的网站 ercc.cc 我的网站 any42.top 手机上! 别人的网站手机上点击有心形特效 我的网站点击没反应 不出心型 这是怎么回事呢 我把 js 代码到 header.php 了 纯小白 求助

    Gladoos
        1
    Gladoos  
    OP
       2018-11-05 19:01:24 +08:00
    有大佬指导一下吗 我自己想了好几天了 谢谢了
    xxx749
        2
    xxx749  
       2018-11-05 19:04:40 +08:00 via Android   ❤️ 1
    我猜没绑定触屏事件🤥
    Gladoos
        3
    Gladoos  
    OP
       2018-11-05 19:07:51 +08:00
    @xxx749 手机上你打开我的菜单 有心形 但除了菜单 哪都不管用了
    xxx749
        4
    xxx749  
       2018-11-05 19:45:01 +08:00 via Android   ❤️ 1
    你把 section 标签的 z-index 改成-1 就好了
    jingyulong
        5
    jingyulong  
       2018-11-05 19:47:51 +08:00   ❤️ 1
    没有看到你加载的 js 和 css,ax.js 和样式你放哪里了
    xxx749
        6
    xxx749  
       2018-11-05 19:54:53 +08:00 via Android   ❤️ 1
    @xxx749 🤥改成 0 就好,-1 点不到了
    zbinlin
        7
    zbinlin  
       2018-11-05 20:40:07 +08:00   ❤️ 1
    你把 `dztx.js` 那行放错位置了,把它放到 `</head>` 的前面(即 `</script>` 与 `</head>` 之间)
    huhexian
        8
    huhexian  
       2018-11-05 21:37:40 +08:00
    在这居然看到了无人小站
    Gladoos
        9
    Gladoos  
    OP
       2018-11-06 08:44:52 +08:00 via Android
    @zbinlin 大佬 插入了 但是手机上还是没效果 能再帮我看看吗 谢谢了
    Gladoos
        10
    Gladoos  
    OP
       2018-11-06 15:20:25 +08:00
    @jingyulong 引入代码应该放在哪呢 引入这个 js
    jingyulong
        11
    jingyulong  
       2018-11-06 15:41:06 +08:00   ❤️ 1
    点击的心形 js 在 ax.js 里面,还有心形的 css 也要引入。css 可以放在 header.php ,js 可以放在 footer.php,先引入代码,接下来再看其他的。
    jingyulong
        12
    jingyulong  
       2018-11-06 15:46:04 +08:00   ❤️ 1
    我看错了。。。原来是手机上,我再看看哈
    Gladoos
        13
    Gladoos  
    OP
       2018-11-06 15:47:58 +08:00
    @jingyulong 大佬 你看一下 不用手机 在电脑上把网页一直缩小 直到点击不出心型 是缩小造成的问题 好像被东西盖住了
    Gladoos
        14
    Gladoos  
    OP
       2018-11-06 15:50:16 +08:00
    @jingyulong ax.js 放在哪啊 我的叫 abc.js 为什么我检查我的网站 找不到<script src="/abc.js"></script>这句呢
    Gladoos
        15
    Gladoos  
    OP
       2018-11-06 15:52:05 +08:00
    <script type="text/javascript">
    if (!!window.ActiveXObject || "ActiveXObject" in window) { //is IE?
    alert('请抛弃万恶的 IE 系列浏览器吧。');
    }
    </script>
    <script src="https://any42.top/wp-content/themes/Siren-master/js/abc.js"></script>
    <script src="https://any42.top/wp-content/themes/Siren-master/js/dztx.js"></script>
    </head>
    <body <?php body_class(); ?>>
    <section id="main-container">
    <?php
    if(!akina_option('head_focus')){
    这是我 header.php 引用的地方

    @jingyulong
    jingyulong
        16
    jingyulong  
       2018-11-06 15:59:17 +08:00   ❤️ 1
    你的我检查了一下,的确叫 abc.js. 在 hearts[i].el.style.cssText 这一行,最后加上
    +";z-index:"+99999
    就好了
    Gladoos
        17
    Gladoos  
    OP
       2018-11-06 16:00:24 +08:00
    @xxx749 在哪改呢 在 点击特效.js 里面改吗 section 标签在哪 我是小白
    Gladoos
        18
    Gladoos  
    OP
       2018-11-06 16:03:55 +08:00
    @jingyulong (+";z-index:"+99999)是括号里面的吗 加在哪里啊 我不会 谢谢大佬帮我检查
    Gladoos
        19
    Gladoos  
    OP
       2018-11-06 16:08:16 +08:00
    @jingyulong 我找到了 你看加的对吗 谢谢大佬= =
    jingyulong
        20
    jingyulong  
       2018-11-06 16:11:43 +08:00   ❤️ 1
    hearts[i].color;+";z-index:"+99999999999
    改为:
    hearts[i].color+";z-index:"+99999999999
    把 hearts[i].color 后面的分号去掉
    jingyulong
        21
    jingyulong  
       2018-11-06 16:12:33 +08:00   ❤️ 1
    hearts[i].color+";z-index:"+99999999999;
    最后面分号也加上哈
    Gladoos
        22
    Gladoos  
    OP
       2018-11-06 16:27:00 +08:00
    @jingyulong 我好笨啊 为什么加上了 不管用啊 再帮忙看一下吧 谢谢大佬 谢谢。。。
    Gladoos
        23
    Gladoos  
    OP
       2018-11-06 16:37:44 +08:00
    "hearts[i].color+";z-index:"+99999999999; 好像有问题 检查有红波浪线
    @jingyulong
    Gladoos
        24
    Gladoos  
    OP
       2018-11-06 16:50:06 +08:00
    @jingyulong 我弄好啦 哈哈哈哈哈哈哈 谢谢大佬帮忙 大佬来试试吧 XD
    Gladoos
        25
    Gladoos  
    OP
       2018-11-06 16:53:26 +08:00
    感谢各位大佬帮忙 谢谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2832 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 14:53 · PVG 22:53 · LAX 07:53 · JFK 10:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.