Skip to content

Instantly share code, notes, and snippets.

View mdwt's full-sized avatar

Meiring de Wet mdwt

View GitHub Profile
@mdwt
mdwt / checkout-layout.js
Last active March 17, 2021 08:04
Changing the Layout of your Kajabi Checkout Pages for Mobile Devices
/*
Copyright (C) 2020-2021 by Meiring de Wet
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@mdwt
mdwt / checkout-layout.js
Last active September 20, 2020 19:45
Simple script to change the layout of a Kajabi checkout page for mobile devices. The script swops the payment details and offer details sections on the new checkout pages..
function isMobile() {
return (window.innerWidth <= 991);
}
function cb() {
try {
const [a, b,] = document.getElementsByClassName('container')[1]?.children[1]?.children;
if (a && b && isMobile()) {
a.parentNode.insertBefore(b, a);