• 0

Launch Lightbox from OnClick function?


Question

return '<img src="' . $link . '" onload="if(this.width > 600) {this.width=600;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="2" />';

How would I launch lightbox from the onclick funtion? I know I can wrap and anchor around the img tag, but I want to load the lightbox from the onclick :)

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

onclick="jQuery.facebox(' . $link . ');

Doesn't work :( No errors. But doen't launch facebox.

		 return '<img src="' . $link . '" onload="if(this.width > 600) {this.width=600;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="jQuery.facebox(' . $link . ');" border="0" />';

Link to comment
Share on other sites

  • 0
did you include the javascriptsrc properly?

attach the events properly?

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox() 
})

im pretty sure i am.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.