Forum Discussion
3d Parallax Effect using Javascript
Hello,
Can someone explain me step by step how can I create a similar effect for my as in this example?
I tried the methods that are mentioned here, but no luck.
- PhilMayorSuper Hero
The video instructions do work, I think I loaded the library in a trigger instead of sideloading it
- sofianteliopoulCommunity Member
Thank you Phil for your answer!
I used this code in the trigger (-When the timeline starts on the slide), and I did not download any additional file in story_content, or change the HTML file.
var myElement = document.querySelectorAll("[data-acc-text~='rec']");
var myCode = function() {
$('.myElement').tilt({
maxTilt:25,
perspective:1000,
easing:"cubic-bezier(.03,.98,.52,.99)",
scale:1.1,
speed:300,
transition:true,
disableAxis:null,
reset:true,
glare:false,
maxGlare:1
})
}if (window.$ != null) { // If jQuery has already loaded, run myCode.
myCode();
} else { // Else, load jQuery and then run myCode.
var jQueryLoader = document.createElement("script");
jQueryLoader.src = "https://cdnjs.cloudflare.com/ajax/libs/tilt.js/1.2.1/tilt.jquery.min.js";
jQueryLoader.onload = function() {
jQueryLoader.onload = null;
myCode();
}
document.head.appendChild(jQueryLoader);
}
I'm unsure whether I should choose a specific element in my slide, such as a rectangle with the accessibility attribute "rec.", or not. I find the specifications of .tilt function in another website. Since my JavaScript knowledge is limited, I could really use some assistance. Thank you in advance for any guidance!
- NicolasChumpitaCommunity Member
Hola, yo también estoy en búsqueda del código del efecto 3D parallax pero sin suerte...
- NicolasChumpitaCommunity Member
Hello, I am also looking for the code for the 3D parallax effect but without luck...
- WilliamSanders-Community Member
I have yet to be successful at getting tilt.js to execute correctly. Does anyone have any tips or tricks on how they got the effect to work correctly? I would appreciate any advice or examples they would care to share.
- MathNotermans-9Community Member
First ensure you load your libraries... jQuery and Tilt. If that works...the rest is easy.
- MathNotermans-9Community Member
You donot need TiltJs to create a tilting effect. You can do it with GSAP. And GSAP is build into Storyline.
Here you can see that work.
https://360.articulate.com/review/content/f9dc490c-5264-49ef-a6e9-9e2b8faf3596/review
To control the tilt-effect exactly as you want/need you need to dive deep into your math, and make a calculation that does the trick.
The sample as shown is added here.
In part2 i will show how to add jQuery an TiltJS and get that working...