Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active February 11, 2018 23:08
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 lettergram/6fa2bdf384d965b8b4f143b1867b1818 to your computer and use it in GitHub Desktop.
Save lettergram/6fa2bdf384d965b8b4f143b1867b1818 to your computer and use it in GitHub Desktop.
Hide section(s) in detail wrappers based on window size or screen size
if ($(window).width() < 900) {
document.getElementById("meta_market_section").style = "display:inline;";
var details = "<details>";
details += "<summary>Market Data (click for details)</summary>";
details += document.getElementById("meta_market_section").innerHTML;
details += "</details>";
$("#meta_market_section").html(details);
document.getElementById("related_section").style = "display:inline;";
details = "<br><details>";
details += "<summary>Related Assets (click for details)</summary>";
details += document.getElementById("related_section").innerHTML;
details += "</details>";
$("#related_section").html(details);
}
document.getElementById("meta_market_container").style = "text-align:left;";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment