[英]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.