philip
April 22, 2017, 6:09am
1
If jQuery is included in Bubble by default, why am I not able to run jQuery code?
"Uncaught ReferenceError: $ is not defined"
From
$(document).ready(function(){
$("#anchor").parents("div.bubble-element.Group").css("height","100vh");
$(".main-page").css("height","100vh")
});
One of the struggles with Bubble can be the dynamic setting of a group’s height, for instance having an element be 100% of the viewport height.
Here’s how to do it:
Create a small HTML element in the group you want to target. Inside of it create an empty div, and assign it a class or ID (in this example I used an id of “anchor”)
<div id="anchor"></div>
Install the JavaScript Toolkit Plugin. This will give you the ability to run JS within a workflow.
Create a new workflow for the page…
philip
April 22, 2017, 6:11am
2
Same error when replacing $ with jQuery.
DaveA
April 22, 2017, 6:30am
3
Open the page you want the code to run on, open the dev console on chrome, paste the code in there…
Even if a page doesn’t have jquery as part of it, the console does.
If the code works, then there is a problem with the page markup, if the code doesn’t then there is a problem with the code snippet.
philip
April 22, 2017, 6:31am
4
Thank you for the quick reply. I’ll try your advice.
system
Closed
July 1, 2017, 6:10am
5
This topic was automatically closed after 70 days. New replies are no longer allowed.