2012-03-20 5 views
1

나는 이것을 내 워드 프레스 웹 사이트에 설치했다. http://sharethis.com/ShareThis WP 플러그인 - 사용 안함을 설정 하시겠습니까?

플러그인은 훌륭하게 작동하며 내 모든 게시물 끝에 좋은 'ShareThis'버튼을 추가합니다.

but. 이상한 이유로, 그것은 onclick과는 반대로 움직이고 호버에서 작동합니다. 매우 이상합니다. 아무도 내가 마우스를 올려 놓으면 이것을 해제 할 수 있고 정상적인 버튼처럼 onclick으로 향하게 할 수 있습니까?

if (!window.console || !console.firebug) { 
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", 
       "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; 
    window.console = {}; 
    for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {}; 
} 


var startPos=1; 

function st_log() { 
    _gaq.push(['_trackEvent', 'WordPressPlugin', 'ConfigOptionsUpdated']); 
    _gaq.push(['_trackEvent', 'WordPressPlugin', "Type_" + $("#st_current_type").val()]); 
    if ($("#get5x").attr("checked")) { 
     _gaq.push(['_trackEvent', 'WordPressPlugin', "Version_5x"]); 
    } else if ($("#get4x").attr("checked")) { 
     _gaq.push(['_trackEvent', 'WordPressPlugin', "Version_4x"]); 
    } 
} 

function getStartPos(){ 
    var arr=[]; 
    arr['_large']=1; 
    arr['_hcount']=2; 
    arr['_vcount']=3; 
    arr['classic']=4; 
    arr['chicklet']=5; 
    arr['chicklet2']=6; 
    arr['_buttons']=7; 
    if(typeof(arr[st_current_type])!=="undefined"){ 
     startPos=arr[st_current_type]; 
    } 
} 


jQuery(document).ready(function() { 
    getStartPos(); 
    if(/updated=true/.test(document.location.href)){ 
     $('#st_updated').show(); 
    } 
    jQuery("#carousel").jcarousel({ 
     size:7, 
     scroll:1, 
     visible:1, 
     start:startPos, 
     wrap:"circular", 
     itemFirstInCallback: { 
      onAfterAnimation: carDoneCB 
     }, 
     itemFallbackDimension:460 
    }); 

    $('#st_services').bind('keyup', function(){ 
     clearTimeout(stkeytimeout); 
     stkeytimeout=setTimeout(function(){makeTags();},500); 
    }) 

    $('#st_pkey').bind('keyup', function(){ 
     clearTimeout(stpkeytimeout); 
     stpkeytimeout=setTimeout(function(){makeHeadTag();},500); 
    }) 

    var services=$('#st_services').val(); 
    svc=services.split(","); 
    for(var i=0;i<svc.length;i++){ 
     if (svc[i]=="fblike"){ 
      $('#st_fblike').attr('checked','checked'); 
     } else if (svc[i]=="plusone"){ 
      $('#st_plusone').attr('checked','checked'); 
     } 
    } 

    $('#st_fblike').bind('click', function(){ 
     if ($('#st_fblike').attr('checked')) { 
      if ($('#st_services').val().indexOf("fblike")==-1) { 
       var pos=$('#st_services').val().indexOf("plusone"); 
       if (pos==-1) 
        $('#st_services').val($('#st_services').val()+",fblike"); 
       else { 
        var str=$('#st_services').val(); 
        if (pos==0) 
         $('#st_services').val("fblike,"+str.substr(pos)); 
        else 
         $('#st_services').val(str.substr(0,pos-1)+",fblike"+str.substr(pos-1)); 
       } 
      } 
     } 
     else { 
      var pos=$('#st_services').val().indexOf("fblike"); 
      if (pos!=-1) { 
       var str=$('#st_services').val(); 
       if (pos==0) 
        $('#st_services').val(str.substr(pos+7)); 
       else 
        $('#st_services').val(str.substr(0,pos-1)+str.substr(pos+6)); 
      } 
     } 
     clearTimeout(stpkeytimeout); 
     stpkeytimeout=setTimeout(function(){makeTags();},500); 
    }) 

    $('#st_plusone').bind('click', function(){ 
     if ($('#st_plusone').attr('checked')) { 
      if ($('#st_services').val().indexOf("plusone")==-1) { 
       $('#st_services').val($('#st_services').val()+",plusone"); 
      } 
     } 
     else { 
      var pos=$('#st_services').val().indexOf("plusone"); 
      if (pos!=-1) { 
       var str=$('#st_services').val(); 
       if (pos==0) 
        $('#st_services').val(str.substr(pos+8)); 
       else 
        $('#st_services').val(str.substr(0,pos-1)+str.substr(pos+7)); 
      } 
     } 
     clearTimeout(stpkeytimeout); 
     stpkeytimeout=setTimeout(function(){makeTags();},500); 
    }) 
}); 

var stkeytimeout=null; 
var stpkeytimeout=null; 

function makeHeadTag(){ 
    var val=$('#st_pkey').val(); 
    var tag=$('#st_widget').val(); 
    var reg=new RegExp("(publisher:)('|\")(.*?)('|\")",'gim'); 
    var b=tag.replace(reg,'$1$2'+val+'$4'); 
    $('#st_widget').val(b); 
} 


function makeTags(){ 
    var services=$('#st_services').val(); 
    var type=$('#curr_type').html(); 
    svc=services.split(","); 
    var tags="" 
    var dt="displayText='share'"; 
    if(type=="chicklet2"){ 
     dt=""; 
    }else if(type=="classic"){ 
     tags="<span class='st_sharethis' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='ShareThis'></span>"; 
     $('#st_tags').val(tags); 
     return true; 
    } 
    if(type=="chicklet" || type=="chicklet2" || type=="classic"){ 
     type=""; 
    } 
    for(var i=0;i<svc.length;i++){ 
     if(svc[i].length>2){ 
      tags+="<span class='st_"+svc[i]+type+"' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' "+dt+"></span>"; 
     } 
    } 
    $('#st_tags').val(tags); 

} 


function carDoneCB(a,elem){ 
    var type=elem.getAttribute("st_type"); 
    $('.services').show() 
    $('.fblikeplusone').show(); 
    if(type=="vcount"){ 
     $('#curr_type').html("_vcount");$("#st_current_type").val("_vcount"); 
     $('#currentType').html("<span class='type_name'>Vertical Count</span>"); 
    }else if(type=="hcount"){ 
      $('#curr_type').html("_hcount");$("#st_current_type").val("_hcount"); 
      $('#currentType').html("<span class='type_name'>Horizontal Count</span>"); 
    }else if(type=="buttons"){ 
      $('#curr_type').html("_buttons");$("#st_current_type").val("_buttons"); 
      $('#currentType').html("<span class='type_name'>Buttons</span>"); 
    }else if(type=="large"){ 
      $('#curr_type').html("_large");$("#st_current_type").val("_large"); 
      $('#currentType').html("<span class='type_name'>Large Icons</span>"); 
    }else if(type=="chicklet"){ 
      $('#curr_type').html("chicklet");$("#st_current_type").val("chicklet"); 
      $('#currentType').html("<span class='type_name'>Regular Buttons</span>"); 
    }else if(type=="chicklet2"){ 
      $('#curr_type').html("chicklet2");$("#st_current_type").val("chicklet2"); 
      $('#currentType').html("<span class='type_name'>Regular Buttons No-Text</span>"); 
    }else if(type=="sharethis"){ 
      $('.services').hide(); 
      $('.fblikeplusone').hide(); 
      $('#curr_type').html("classic");$("#st_current_type").val("classic"); 
      $('#currentType').html("<span class='type_name'>Classic</span>"); 
    } 
    makeTags(); 
} 

$(".versionItem").click(function() { 
    $(".versionItem").removeClass("versionSelect"); 
    $(this).addClass("versionSelect"); 
}); 

업데이트 : 여기

내가 추가해야합니다 어디 있으리라 믿고있어이 플러그인 스크립트가있는 주입니다 이들 문서는이 설명; http://help.sharethis.com/customization/hover-effects.

난 그냥 실패가 아래에 제공하는 코드 창 내에서 복제 시도했다 : 그래서 (아니, 난 내 별표를 유지하지 않았다)

<script charset="utf-8" type="text/javascript">var switchTo5x=true;</script><script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'29b6d061-87e2-4726-9341-a2a77f404df6'});  

stLight.options({ 
var st_type='wordpress3.2.1', 
**onhover: false** 
}); 
</script> 

, 내가 어떻게 할 추측 나는 그들의 Wordpress 플러그 접속 식 버전 안에 그것을 무능하게한다 ????

jQuery를 :

$(selector).hover(function() { }, function() { }); 

자바 스크립트 :

답변

0

mouseover 이벤트 리스너 추가하기위한 몇 가지 방법이 있습니다 그러나

document.getElementById(selector).addEventListener('mouseover', function() { }, false); 
document.getElementById(selector).addEventListener('mouseout', function() { }, false); 

를, 내가 사용 이러한 방법 중 하나를 볼 수 없습니다 이 코드에서. 이것은 내가 다른 곳에서 선언되고 있다고 믿게한다. 더 많은 정보를 제공 할 수 있습니까? "다른 위젯의 옵션을 수정하기 위해 클릭"절에 거짓 stLight.options 나를 위해

작품에서 :

+0

$ ('. selector'). unbind ('hover')를 사용하면 마우스가 끝났을 때 플러그인이 표시되지 않도록 할 수 있습니까? – chepe263

+1

그렇게 할 수는 있지만 작동자가 연결되어있는 선택기를 알아야합니다. 이것은 버튼이 쳐져있을 때 표시되는'div'입니다 :

. 코드와 백 페달에서'$ ('# stOverlay')'를 찾을 수 있는지 확인하십시오. –

0

당신은 워드 프레스를 사용하는 경우, onhover을 배치>> 설정하기 ShareThis 이동합니다.

+0

버전 7.0.6 사용 해당 옵션이 표시되지 않습니다. 1 단계에서 '추가 옵션 선택'이 표시되지만 3 개의 미리보기 이미지에서 마우스 오버를 제거하기위한 옵션은 표시되지 않습니다. ((비록 이해할 수 있음) – Xtremefaith

관련 문제