2012-11-27 4 views
0

내가 qTip2를 사용하여 내 Umbraco 설치를하고 있습니다. 롤오버에서 전체 크기의 이미지를 표시하기 위해 서식있는 텍스트 편집기에 이미지를 삽입하고 싶습니다.qTip2 롤오버 섬네일 표시 전체 크기의 이미지

문제는 전체 크기보다 Umbraco의 서식있는 텍스트 편집기를 표시 이미지 작은입니다. 서식있는 텍스트 편집기의 너비에 맞추기. 프론트 엔드에 표시되는 이미지에는 '_360x200.jpg은'대신 '.JPG'의 추가

나는 fullstop/기간 때까지 후 밑줄 모든 것을 대체 할 수있는 방법

?

// Create the tooltips only on document load 
    $(document).ready(function() { 
     $('.rightUnevenCol img').each(function() { 
      // Grab fullsize image src 
//Replace the underscore and everything after it before the '.' e.g. '_320x200.jpg' to '.jpg' 
      var bigSrc = $(this).attr('src').replace(/_\d+$/, ""); 
      $(this).qtip({ 
       content: '<img src="' + bigSrc + '" alt="" />', 
       // Set the height/width!!! This can cause positioning problems if not set 
       position: { 
        target: 'mouse', 
        adjust: { 
         mouse: true 
        } 
       }, 
       show: { 
        target: false, 
        event: 'mouseenter', 
        effect: true, 
        delay: 90, 
        solo: false, 
        ready: false, 
        modal: false 
       }, 
       hide: { 
        target: false, 
        event: 'mouseleave', 
        effect: false, 
        delay: 0, 
        fixed: true, 
        when: { 
         event: 'unfocus' 
        }, 
        inactive: false 
       }, 
       style: { 
        tip: false, 
        classes: 'preview' 
       }, 
       events: { 
        render: null, 
        move: null, 
        show: null, 
        hide: null, 
        toggle: null, 
        focus: null, 
        blur: null 
       } 
      }); 
     }); 

     // since the qTip copies the content of the info div, you can remove it now 
     $('.rightUnevenCol img').remove('.preview'); 


    });​ 

답변

1

var bigSrc = $(this).attr('src').replace(/_[^\.]*/, ""); 

을 시도하거나 내 형식이 변경 될 것이다 123x456

var bigSrc = $(this).attr('src').replace(/_\d{1,3}x\d{1,3}/, ""); 
+0

감사 @Yury Tarabanko 내가 첫 번째 옵션을 사용하여 형식에 대한 당신의 경우 확인합니다. – JV10