Jquery photo component

  javascript, jquery

Js and css introduced

<link href="css/prettyPhoto.css" rel="stylesheet"/>
<script src="js/jquery.prettyPhoto.js"></script>

Events

<a href="#" rel="prettyPhoto" title="bpm image" style="display:none"></a>

Set up

<script type="text/javascript">

            $(document).ready(function(){
                $("a[rel^='prettyPhoto']").prettyPhoto({
                    theme:'light_square', //'dark_rounded'
                    show_title: false,
                    social_tools: false,
                    keyboard_shortcuts: true
                });

            });
</script>            

Trigger

You can bind yourself to a button’s click event.

<script type="text/javascript">
function viewPng(){
                var png = 'xxx.png';
                $.prettyPhoto.open(png);
            }
</script>            

References