Open yinxiangshi opened 2 years ago
change id=".ele1"
to id="ele1"
also, make sure the vanta script runs after the dom is already loaded
This is also not working for me. On Fri, Nov 18, 2022 at 02:54 Teng Bao @.***> wrote:
change id=".ele1" to id="ele1"
— Reply to this email directly, view it on GitHub https://github.com/tengbao/vanta/issues/148#issuecomment-1319714589, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHUIB37ZWK6LS5H5V5BJFDLWI474PANCNFSM6AAAAAASBPP3XA . You are receiving this because you authored the thread.Message ID: @.***>
I have the same issue, did you manage to make it work?
@llPekoll , just had the same issue. Resolved by moving the VANTA
script from head
to body
.
Before:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta/dist/vanta.waves.min.js"></script>
<script>
VANTA.WAVES('#my-background');
</script>
</head>
<body></body>
</html>
After:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta/dist/vanta.waves.min.js"></script>
</head>
<body>
<script>
VANTA.WAVES('#my-background');
</script>
</body>
</html>
Not the most elegant, but works for now.
Hi, I am using Hugo to build my web, I got a very strange issue.
My code is:
I got:
vanta.trunk.min.js:1 [VANTA] Cannot find element #ele1