1 Vui vui chút nè: Tự động chèn Logo nho nhỏ vào hình ảnh trong bài viết + Tự động thay link ảnh lỗi 24/4/2012, 4:24 pm
Founder
Admin
DEMO
Modules > Javascript codes management > Create a new javascript
Placement : Chọn In the sub-forums + In the topics
Cuối cùng cho đoạn js này vào và lưu lại.
- Code:
$(window).load(function() {
$('.blog_message img,.postbody img').show(function(){
if($(this).width() >= 200)
{
$(this).before('<div style="position:relative;"><img style="z-index:10; width:100%; position:absolute; left:-10px; top:-10px; opacity: 0.7;filter: alpha(opacity=70);" src="http://i49.servimg.com/u/f49/16/29/88/81/logovd12.png"></img></div>');
}
});
});
$(document).ready( function() {
$('.blog_message img,.postbody img').error(function() {
$(this).replaceWith('<img src="http://i49.servimg.com/u/f49/16/29/88/81/imgerr10.png">')
});
});
Xong!
Chú ý thay logo của bạn vào nhé. Logo nho nhỏ thôi, đừng rộng quá 200px nhé!
Nguồn: http://diendan.chinhphuc.info/