Answer the question
In order to leave comments, you need to log in
How to add a "full screen" button to colorbox?
There was a need to add an additional button to the colorbox plugin (an advanced version of lightbox).
The button is extremely simple - it is a direct link to what opens in this lightbox.
implementation:
$(document).ready(function(){
$(".iframe").colorbox({
iframe:true, innerWidth:"90%", height:"90%",
onComplete: function() {
$("#cboxContent iframe").ready(function(){
$("#cboxContent").append('<a id="cboxFullScr" style="float: left;">full screen</a>');
$("#cboxFullScr").attr("href", $.colorbox.element().attr("href"));
});
}
});
});
Answer the question
In order to leave comments, you need to log in
$(document).ready(function(){
$(".iframe").each(function(){
var that = $(this);
that.colorbox({
iframe:true, innerWidth:"90%", height:"90%",
onComplete: function() {
$("#cboxContent iframe").ready(function(){
$("#cboxContent").append('<a id="cboxFullScr" style="float: left;" href=' + that.attr("href") + '>full screen</a>');
});
}
});
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question