Skip to content

Instantly share code, notes, and snippets.

@doublejosh
Created November 29, 2016 20:41
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 doublejosh/6ff5c44142e9d2c7bfcd8108dd349aa6 to your computer and use it in GitHub Desktop.
Save doublejosh/6ff5c44142e9d2c7bfcd8108dd349aa6 to your computer and use it in GitHub Desktop.
Late click via param
/**
* @file Click a DOM element via parameter (after the page load).
*
* Example: /techspecs?click=personal-sources#data-sources
*/
(function ($) {
/**
* @todo waitFor().
*/
function clickParam() {
var parsed = Tabia.util.parseUrl();
if (_.has(parsed.params, 'click')) {
$('#' + parsed.params.click).click();
}
}
$(document).ready(clickParam);
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment