Share hiệu ứng thu phóng ảnh.

  • Thread starter Thread starter boy94
  • Start date Start date
boy94

boy94

Well-Known Member
Vip
Chèn mã này vào file css của bạn:
PHP:
 .****** img{ -webkit-transform:scale(0.8); /*Webkit: Scale down image to 0.8x original size*/ -moz-transform:scale(0.8); /*Mozilla scale version*/ -o-transform:scale(0.8); /*Opera scale version*/ -webkit-transition-duration: 0.5s; /*Webkit: Animation duration*/ -moz-transition-duration: 0.5s; /*Mozilla duration version*/ -o-transition-duration: 0.5s; /*Opera duration version*/ opacity: 0.7; /*initial opacity of images*/ margin: 0 10px 5px 0; /*margin between images*/ }
.****** img:hover{ -webkit-transform:scale(1.1); /*Webkit: Scale up image to 1.2x original size*/ -moz-transform:scale(1.1); /*Mozilla scale version*/ -o-transform:scale(1.1); /*Opera scale version*/ box-shadow:0px 0px 30px gray; /*CSS3 shadow: 30px blurred shadow all around image*/ -webkit-box-shadow:0px 0px 30px gray; /*Safari shadow version*/ -moz-box-shadow:0px 0px 30px gray; /*Mozilla shadow version*/ opacity: 1; }


Như vậy mỗi khi viết bài có hình ảnh các bạn chỉ cần bật qua HTML và dán code sau:

PHP:
<div class="******">
<img src="URL" />
<img src="URL" />
</div>


Code:
Các bạn có thể thay đổi số tô xanh theo ý muốn: 
0.8 : độ thu nhỏ của ảnh khi chưa rê chuột (muốn ảnh bình thường thì đặt là 1)
0.5 : thời gian
1.1 : độ phóng to của ảnh khi rê chuột vào

Thích hợp trên các trình duyệt : Firefox 3.6+ , G.Chrome , Safari 4+ , Opera 9.5+ .
Không áp dụng trên IE .





demo PC: Heroes Lore : Zero By EA Mobile
 

Facebook Comments

Similar threads

Admin
Replies
0
Views
3K
AdminAdmin is verified member.
Admin
cuongpro9x
Replies
5
Views
8K
AdminAdmin is verified member.
Admin
cuongpro9x
Replies
0
Views
2K
cuongpro9xcuongpro9x is verified member.
cuongpro9x
Admin
Replies
0
Views
3K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
6
Views
8K
SuperTroll
SuperTroll
Back
Top