Diễn đàn Clan Yalz
Bạn đã là thành viên xin hãy đăng nhập, còn chưa thì hãy đăng kí nha!
Diễn đàn Clan Yalz
Bạn đã là thành viên xin hãy đăng nhập, còn chưa thì hãy đăng kí nha!
Diễn đàn Clan Yalz
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
Diễn đàn Clan Yalz


 
Trang ChínhTrang Chính  Latest imagesLatest images  Đăng kýĐăng ký  Đăng NhậpĐăng Nhập  

Share | 

 

 Code resize Ảnh

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down 
Code resize Ảnh EmptyFri Jun 04, 2010 12:41 am

Yalz÷Kiêu
Thủ lĩnh

Yalz÷Kiêu

Thủ lĩnh

https://clanyalz.forum-viet.com
Số bài gửi Số bài gửi : 244
Ngày tham gia Ngày tham gia : 27/02/2010
Tuổi Tuổi : 30
Đến từ Đến từ : Thiên đường

Bài gửiTiêu đề: Code resize Ảnh

 
vào viewtopic_body tìm đoạn

Code:
<!-- BEGIN switch_image_resize -->
<script type="text/javascript">
//<![CDATA[
$(resize_images({ 'selector' : '.postbody', 'max_width' : {switch_image_resize.IMG_RESIZE_WIDTH}, 'max_height' : {switch_image_resize.IMG_RESIZE_HEIGHT} }));
//]]>
</script>
<!-- END switch_image_resize -->

Thay bằng đoạn:

Code:
<!-- BEGIN switch_image_resize -->
<script type="text/javascript">
//<![CDATA[
$(function(){
  $('.postbody img').not('.signature_div img').css('display','none');
});
$(window).load(function(){
  $('.postbody img').not('.signature_div img').each(function(){
      if ( ( $(this).width() > {switch_image_resize.IMG_RESIZE_WIDTH} && {switch_image_resize.IMG_RESIZE_WIDTH} != 0 ) || ( $(this).height() > {switch_image_resize.IMG_RESIZE_HEIGHT} && {switch_image_resize.IMG_RESIZE_HEIGHT} != 0 ) ) {
        $(this).before(document.createElement('div')).prev().click(function(){
            return false;
        }).addClass('resizebox gensmall clearfix').append(document.createElement('div')).children().addClass('resize_border clearfix').append(document.createElement('div')).children().addClass('resize_content clearfix').append(document.createElement('a')).children().addClass('enlarge').attr('href', '#').text('[Phóng To Ảnh]').click(function(){
            $(this).parent().parent().parent().next().css('display','none').attr('resizeWidth', $(this).parent().parent().parent().next().width()).width('');
            $(this).parent().parent().parent().next().width($(this).parent().parent().parent().next().width() > ($('html').attr('dir') != 'rtl' ? $(this).closest('td').width() - $(this).parent().parent().parent().offset().left + $(this).closest('td').offset().left : $(this).parent().parent().parent().width() + $(this).parent().parent().parent().offset().left - $(this).closest('td').offset().left) ? $('html').attr('dir') != 'rtl' ? $(this).closest('td').width() - $(this).parent().parent().parent().offset().left + $(this).closest('td').offset().left : $(this).parent().parent().parent().width() + $(this).parent().parent().parent().offset().left - $(this).closest('td').offset().left : '').css('display','inline');
            $(this).css('display','none').next('a.resize').css('display','inline-block');
            $(this).parent().parent().parent().width('').width($(this).parent().parent().parent().next().width());
            return false;
        }).parent().append(document.createElement('a')).children().next().addClass('resize').attr('href','#').text('[Thu Nhỏ Ảnh]').click(function(){
            $(this).parent().parent().parent().next().width(parseInt($(this).parent().parent().parent().next().attr('resizeWidth'))).removeAttr('resizeWidth');
            $(this).css('display','none').prev('a.enlarge').css('display','inline-block');
            $(this).parent().parent().parent().width('').width($(this).parent().parent().parent().next().width());
            return false;
        }).parent().append(document.createElement('div')).children('a.resize').next().addClass('resize_filler').text(' ').parent().append(document.createElement('a')).children('div.resize_filler').next().addClass('fullsize').attr('href','#').click(function(){
            window.open('/viewimage.forum?u=' + encodeURIComponent($(this).parent().parent().parent().next().attr('src')));
            return false;
        }).attr('target', '_blank').text('[Kích Thước Thật]');
        if ($(this).width() > ($('html').attr('dir') != 'rtl' ? $(this).closest('td').width() - $(this).prev().offset().left + $(this).closest('td').offset().left : $(this).prev().width() + $(this).prev().offset().left - $(this).closest('td').offset().left)){
            $(this).prev().find('a.fullsize').attr('href','/viewimage.forum?u=' + encodeURIComponent($(this).attr('src'))).css('display', 'inline-block');
        }
        $(this).width($(this).width() * ( ( {switch_image_resize.IMG_RESIZE_WIDTH} != 0 && ( {switch_image_resize.IMG_RESIZE_HEIGHT} == 0 || $(this).width() / $(this).height() > {switch_image_resize.IMG_RESIZE_WIDTH} / {switch_image_resize.IMG_RESIZE_HEIGHT} ) ) ? {switch_image_resize.IMG_RESIZE_WIDTH} / $(this).width() : {switch_image_resize.IMG_RESIZE_HEIGHT} / $(this).height() ) ).css('display','inline').prev().width($(this).width());
      }
  }).css('display','inline');
});
//]]>
</script>
<!-- END switch_image_resize -->

vào Css thêm vào đoạn:

Code:
.resize_process .resizebox {
    display:none;
    }
    .resize_process img.resize_img {
    display:none;
    }
    .resizebox a.enlarge, .resizebox a.fullsize, .resizebox a.resize {
    display:inline-block;
    }
    .resizebox.enlarged a.enlarge {
    display:none;
    }
    .resizebox.enlarged a.resize {
    display:inline-block;
    }
    .resizebox a.resize {
    display:none;
    }
    .resizebox {
    background-color:#FFFFFF;
    cursor:default;
    display:inline-block;
    font-style:normal;
    font-weight:normal;
    line-height:1.1em;
    margin:0;
    max-width:100%;
    text-align:left;
    }
    .resizebox div {
    font-style:normal;
    font-weight:normal;
    margin:0;
    }
    .resizebox .resize_border {
    border:1px solid #FFFFFF;
    display:block;
    }
    .resizebox .resize_content {
    display:inline-block;
    padding:5px 10px;
    }
    .resizebox .resize_filler {
    border:medium none;
    display:inline-block;
    padding:0;
    width:40px;
    }

 

Code resize Ảnh

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang 
Trang 1 trong tổng số 1 trang

Permissions in this forum:Bạn không có quyền trả lời bài viết
Diễn đàn Clan Yalz :: Phần mềm :: Forum - Css - Code-

Powered by phpBB® Version 2.0. Forumotion..

 
Free forum | Văn hóa | Khác | ©phpBB | Free forum support | Báo cáo lạm dụng | Thảo luận mới nhất