Skip to content

Instantly share code, notes, and snippets.

@xlimit91
Created February 16, 2020 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlimit91/f7b52b30ba578139e88ea8c71d448d2b to your computer and use it in GitHub Desktop.
Save xlimit91/f7b52b30ba578139e88ea8c71d448d2b to your computer and use it in GitHub Desktop.
window.addEventListener("load", function() {
// hearthis html code
var t = jQuery("[id^='hearthis_at_']");
if (1 == t.length) {
/*
var e = t.closest(".wpb_wrapper").parent("div");
e.closest(".vc_column-inner").first(".wpb_wrapper").css({
"padding-top": e.outerHeight() - 30 + "px"
}), jQuery(e).addClass("cst-htp-sty")
*/
} else {
// hearthis embed code
if (1 == jQuery("iframe[src^='https://hearthis.at/embed']").length) {
var t = jQuery("iframe[src^='https://hearthis.at/embed']")[0];
jQuery(t).closest(".w-tabs-section-content").css({
"padding-top": jQuery(t).outerHeight() + 25 + "px"
}), jQuery(t).addClass("cst-htp-sty")
}
}
// soundcloud embed code
if (1 == jQuery("iframe[src^='https://w.soundcloud.com/player']").length) {
var t = jQuery("iframe[src^='https://w.soundcloud.com/player']")[0];
jQuery(t).closest(".w-tabs-section-content").css({
"padding-top": jQuery(t).outerHeight() + 25 + "px"
}), jQuery(t).addClass("cst-htp-sty")
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment