WordPress js 求助

2018-11-05 19:01:01 +08:00
 Gladoos

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

3444 次点击
所在节点    JavaScript
25 条回复
Gladoos
2018-11-05 19:01:24 +08:00
有大佬指导一下吗 我自己想了好几天了 谢谢了
xxx749
2018-11-05 19:04:40 +08:00
我猜没绑定触屏事件🤥
Gladoos
2018-11-05 19:07:51 +08:00
@xxx749 手机上你打开我的菜单 有心形 但除了菜单 哪都不管用了
xxx749
2018-11-05 19:45:01 +08:00
你把 section 标签的 z-index 改成-1 就好了
jingyulong
2018-11-05 19:47:51 +08:00
没有看到你加载的 js 和 css,ax.js 和样式你放哪里了
xxx749
2018-11-05 19:54:53 +08:00
@xxx749 🤥改成 0 就好,-1 点不到了
zbinlin
2018-11-05 20:40:07 +08:00
你把 `dztx.js` 那行放错位置了,把它放到 `</head>` 的前面(即 `</script>` 与 `</head>` 之间)
huhexian
2018-11-05 21:37:40 +08:00
在这居然看到了无人小站
Gladoos
2018-11-06 08:44:52 +08:00
@zbinlin 大佬 插入了 但是手机上还是没效果 能再帮我看看吗 谢谢了
Gladoos
2018-11-06 15:20:25 +08:00
@jingyulong 引入代码应该放在哪呢 引入这个 js
jingyulong
2018-11-06 15:41:06 +08:00
点击的心形 js 在 ax.js 里面,还有心形的 css 也要引入。css 可以放在 header.php ,js 可以放在 footer.php,先引入代码,接下来再看其他的。
jingyulong
2018-11-06 15:46:04 +08:00
我看错了。。。原来是手机上,我再看看哈
Gladoos
2018-11-06 15:47:58 +08:00
@jingyulong 大佬 你看一下 不用手机 在电脑上把网页一直缩小 直到点击不出心型 是缩小造成的问题 好像被东西盖住了
Gladoos
2018-11-06 15:50:16 +08:00
@jingyulong ax.js 放在哪啊 我的叫 abc.js 为什么我检查我的网站 找不到<script src="/abc.js"></script>这句呢
Gladoos
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
2018-11-06 15:59:17 +08:00
你的我检查了一下,的确叫 abc.js. 在 hearts[i].el.style.cssText 这一行,最后加上
+";z-index:"+99999
就好了
Gladoos
2018-11-06 16:00:24 +08:00
@xxx749 在哪改呢 在 点击特效.js 里面改吗 section 标签在哪 我是小白
Gladoos
2018-11-06 16:03:55 +08:00
@jingyulong (+";z-index:"+99999)是括号里面的吗 加在哪里啊 我不会 谢谢大佬帮我检查
Gladoos
2018-11-06 16:08:16 +08:00
@jingyulong 我找到了 你看加的对吗 谢谢大佬= =
jingyulong
2018-11-06 16:11:43 +08:00
hearts[i].color;+";z-index:"+99999999999
改为:
hearts[i].color+";z-index:"+99999999999
把 hearts[i].color 后面的分号去掉

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/504748

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX