Skip to content

Instantly share code, notes, and snippets.

@rakeshjames
Created October 14, 2014 09:37
Show Gist options
  • Save rakeshjames/fff738a8b1d2e42cbc2f to your computer and use it in GitHub Desktop.
Save rakeshjames/fff738a8b1d2e42cbc2f to your computer and use it in GitHub Desktop.
Auto click or auto loading popup with colorbox drupal 7?
<?php
global $base_url;
print "<div class = 'auto-click'><a href='" . $base_url . "/video/1?width=500&height=500' class = 'colorbox-load'></a></div>";
if (!empty($_GET['banner'])) {
$thankyou = $_GET['banner'];
if ($thankyou == 'yes') {
echo "<script langauge='javascript'>
jQuery(window).load(function(){
jQuery('.auto-click a').click();
});
</script>";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment