Here is my timeline.min.js file which is being referenced in the index.html file. Please note that I haven't included the full code.
function timeline(e, v) {
var g = [],
p = "Timeline:",
t = window.innerWidth,
i = void 0,
o = 0,
b = {
forceVerticalMode: { type: "integer", defaultValue: 600 },
horizontalStartPosition: { type: "string", acceptedValues: ["bottom", "top"], defaultValue: "top" },
mode: { type: "string", acceptedValues: ["horizontal", "vertical"], defaultValue: "vertical" },
moveItems: { type: "integer", defaultValue: 1 },
rtlMode: { type: "boolean", acceptedValues: [!0, !1], defaultValue: !1 },
startIndex: { type: "integer", defaultValue: 0 },
verticalStartPosition: { type: "string", acceptedValues: ["left", "right"], defaultValue: "left" },
verticalTrigger: { type: "string", defaultValue: "15%" },
visibleItems: { type: "integer", defaultValue: 3 },
};
function n(e, t, i) {
t.classList.add(i), e.parentNode.insertBefore(t, e), t.appendChild(e);
}
And then at the end of the same Javascript file I have this:
window.jQuery &&
(window.jQuery.fn.timeline = function (e) {
return timeline(this, e), this;
});
Now, in the index.html file, there's a reference to the timeline function where the timeline mode is changed to horizontal.
<script type="text/javascript" src="../src/assets/js/timeline/timeline.min.js"></script>
<script>
timeline(document.querySelectorAll('.timeline'), {
forceVerticalMode: 700,
mode: 'horizontal',
verticalStartPosition: 'left',
visibleItems: 7
});
console.log($("#ble").attr("class"));
</script>
Now, I want to integrate all this inside my React Component because when I'm running the code, the timeline is being shown vertical instead of horizontal. My React Component:
return(
13 Jan, 2020
F2F
......