Đây là một dạng lightbox nhưng có nhiều chức năng hơn như hiển thị cả video và flash. Trang web của bạn sẽ trở nên chuyên nghiệp hơn nếu sử dụng plugin này. Muốn biết nó như thế nào thì bạn click vào hình ở dưới:
Kiểu default
Hiển thị dạng gallery:
Trình diễn Video:
Để sử dụng được plugin này trên blogspot thì bạn chèn đoạn code sau phía trên thẻ </body>
<link href='http://www.no-margin-for-errors.com/wp-content/themes/NMFE/css/prettyPhoto.css' media='screen' rel='stylesheet' type='text/css'/>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script src='http://www.no-margin-for-errors.com/wp-content/themes/NMFE/js/jquery.prettyPhoto.js' type='text/javascript'/>
<script type='text/javascript'>
jQuery("a[rel^='prettyPhoto']").prettyPhoto();
</script>
Sau đó, trong khi đăng ảnh trong bài thì bạn thêm dòng rel="prettyphoto" như thế này:
<a href="image.jpg" rel="prettyphoto"><img src="..."/></a>
Để hiển thị kiểu gallery thì sửa thành rel="prettyPhoto[pp_gal]" , còn muốn xem video thì thay link ảnh image1 thành link dẫn tới video đó, ví dụ như : http://www.youtube.com/watch?v=_EC2tmFVNNE
- Nên upload các file css và js lên host riêng.
0 comments
Post a Comment