Hi !
I was using thickBox in one of my plugins, and the thing I liked about it is that it wasn't necessary to add anything to the theme files. You simply had to generate a correctly formed link, and thickBox would automatically handle it.
Now that thickBox is no more, I switched to colorBox, but I'm not really happy with it : I need to add the following piece of code into the section of my theme :
$(document).ready(function(){
$(".share_link").colorbox({inline:true, href:"#share_div"});
});
The share_div is the name of the stuff I want to be shown in the colorBox box. Is there any way to get rid of that piece ? My plugin is only one function which adds the stuff to my image page, and the link to display it in a box.
I'd like to keep it that way (e.g. only one function to call, and no other theme modification)
You could use addPluginScript() to add it to the header code output by zenJavascript(). It will still require that zenJavascript() is called to output the code, however. Most themes will already have this call included.
Thx for the reply. I was just going to reply to myself telling me I'm stupid
I can simply add the $(".share_link").colorbox({inline:true, href:"#share_div"});
line just after the share_div part, I don't have to put it in the document.ready function ! Now I works fine without theme modification
Thx though for the reply. Might help me greatly in another plugin