简体   繁体   English

我需要帮助以使我的徽标和社交图标悬停

[英]I need help making my Logo and Social Icons nopin on hover

I need to remove the hover effect of my pinit button on my site from Every Image. 我需要从“每个图像”中删除我的站点上的pinit按钮的悬停效果。 I want to remove the hover pinit option from the social icons and logo images. 我想从社交图标和徽标图像中删除悬停pinit选项。 My social icons have a hover effect I would like to keep. 我的社交偶像具有悬停效果,我想保留。 I have a test page at www.latulipefloraldesigns.com/blog3.html ... Any help is appreciated! 我在www.latulipefloraldesigns.com/blog3.html上有一个测试页。

HTML.. I have this right above the HTML ..我在

  <script type="text/javascript"  src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  <script type="text/javascript" src="js/jquery.pinit.js"></script>
   <script type="text/javascript">
   $(function () {

  $('img').pinit();

    });
    </script> 

Here is the CSS I have in my style.css 这是我的style.css中拥有的CSS

   .pinit .pinit-overlay {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:200;
display:none;
background:transparent url('../images/hover-1.png') repeat 0 0;
text-align:center;
     }

      /* button style, and center it */
      .pinit .pinit-overlay a {
position:relative;
top:45%;
left:45%;
margin:-10px 0 0 -21px;
display:block;
width:100px;
height:100px;
background:transparent url('../img/pinit-button.png') no-repeat 0 0;
text-indent:-9999em;
        }

        .pinit .pinit-overlay a:hover {
background-positon: 0 -100px;
       }

        .pinit .pinit-overlay a:active {
 background-position: 0 -100px;
       }

The jQuery is in its own file. jQuery在其自己的文件中。

    (function($){

//Attach this new method to jQuery
$.fn.extend({ 

    pinit: function(options) {

        var defaults = {
            wrap: '<span class="pinit"/>',
            pageURL: document.URL
        }       

        var options = $.extend(defaults, options);
        var o = options; 

        //Iterate over the current set of matched elements
        return this.each(function() {

            var e = $(this),
                pi_media = e.data('media') ? e.data('media') : e[0].src,
                pi_url = o.pageURL,
                pi_desc = e.attr('title') ? e.attr('title') : e.attr('alt'),
                pi_isvideo = 'false';
                 bookmark = 'http://pinterest.com/pin/create/bookmarklet/?media=' +             encodeURI    (pi_media) + '&url=' + encodeURI(pi_url) + '&is_video=' + encodeURI (pi_isvideo) + '&description=' + encodeURI(pi_desc);

            var eHeight = e.outerHeight();              
                e.wrap(o.wrap);
                e.after('<span class="pinit-overlay" style="height: ' + eHeight + 'px"><a      href="' + bookmark + '" class="pinit-button">Pin It</a></span>');

            $('.pinit .pinit-button').on('click', function () {             
                window.open($(this).attr      ('href'), 'Pinterest', 'width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1');              
                return false;
            });     

            $('.pinit').mouseenter(function () {
                $(this).children('.pinit-overlay').fadeIn(200);
            }).mouseleave(function () {
                $(this).children('.pinit-overlay').fadeOut(200);
            });


        });

    }

});

  })(jQuery);

In your HTML script, just target it like this instead: 在您的HTML脚本中,只需像这样定位它:

$('#content img').pinit();

Then it will only target items that are within your content ID. 然后,它将仅定位content ID. It will not target things located in your header or footer (ie. social media icons). 它不会定位到您的页眉或页脚中的内容(即社交媒体图标)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试在我的反应应用程序中添加图标,但此方法不起作用需要帮助和指导 - I am trying to add icons in my react app but this method not working Need help and guidance 如何在代码中添加社交媒体图标? - How do I add social media icons to my code? 我需要在JS中制作交互式Sprite的帮助 - I need help making an interactive sprite in JS 我需要在JavaScript中进行HitTest的帮助 - I need help making a HitTest in JavaScript 我的导航链接上的 hover 选择器中使用的字母间距使我的徽标在导航栏中横向移动 - the letter-spacing used in my hover selector on my nav-links is making my logo shift sideways in my navigation bar 我创建了一个滑出社交媒体图标的 animation。 但是,我需要将其应用于多个 div - I've created an animation that slides out social media icons. However, I need to apply this to multiple divs 如何使我的徽标 go 向左,我的导航栏图标在中间? - How do I make my logo go towards the left and my nav bar icons in the middle? 我需要帮助来使用 hover 创建自动图像 slider - I need help to create automatic images slider with hover 我需要用JavaScript制作的迷你游戏的帮助 - I need help on a mini game that i am making in javascript 需要帮助显示div悬停 - Need help showing div on hover
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM