Hy Guys…
i have some lightbox script where i can build custom buttons. I’ve maked one buttom to print an image showed in the lightbox.. but the image don’t apear on print window (tested in Google Chrome, Firefox an IE8)… here my
my code:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#getdropdown").change(function() {
var trial=jQuery("#getdropdown option:selected").val();
jQuery.lightbox(trial,{
buttons: [
{
'class' : 'botao-imprimir',
'html' : 'IMPRIMIR',
'callback' : function(url) {
title = window.open(trial);
//title.document.write(trial);
title.print();
}
}
]
});
});
});
</script>
and Here is my HTML:
<select name="getdropdown" class="drop-receitas" id="getdropdown">
<option value="">Escolha aqui a receita desejada</option>
<option value="receitas/image.jpg">Image</option>
<option value="receitas/image2.jpg">Image 2</option>
</select>
on var trial i have the image, and when i select some option on my list, it’s shows the image with the button "IMPRIMIR" (Print).. What i’m doing wrong?
Ty for help!
EDIT: Here is the link with the problem. Click in some item on DropDown
You should open a window object to an HTML page which contains the image in an tag.
Something like this:
Another way of doing it is using a print stylesheet, which hides everyting else, than the image. Take a look here: http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml (First Google hit).