You are here

12 July 2013

How to use colorbox module programmatically. Colorbox module provides with loading inline content, explained here: https://drupal.org/node/1971564. Since that didn't work for me, I tok a different approach.

Source code viewer
  1. <script type="text/javascript">
  2. (function($){$().ready(function(){
  3. $('#colorbox-<?php echo $id; ?>').click(function(){
  4. $(this).colorbox({
  5. href: '<?php echo $orig_file_url; ?>',
  6. 'width': '1024px',
  7. 'height': '768px',
  8. open: true
  9. });
  10. });
  11. });})(jQuery);
  12.  
  13. <a id="colorbox-<?php echo $id; ?>" href="#">
  14. <img src="<?php echo $thumb_file_url; ?>" />
  15. </a>
Programming Language: HTML