纯JS代码实现气泡效果

前端之家收集整理的这篇文章主要介绍了纯JS代码实现气泡效果前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

就不给大家多文字说明了。给大家梳理下关键步骤。

关键步骤:

文件

效果的地方

whats up?

3、使用气泡效果

4、这是jquery.thoughtBubblr.js代码

"; return bubbleContainer; },getMainBubble = function() { return '
'; },getText = function() { return ''; },getBubbles = function() { return '
'; },animate = function(){ var bubbles = $(document).find('.bubble'),reversed = bubbles.get().reverse(),speed = settings.speed; $(reversed[0]).stop().animate({ opacity: 1},speed,function() { $(reversed[1]).animate({ opacity: 1},function() { $(reversed[2]).animate({ opacity: 1},function() { $(reversed[3]).animate({ opacity: 1},speed); }); }); }); },unanimate = function() { var bubbles = $(document).find('.bubble'); bubbles.stop().animate({opacity: 0}); },shiftDiv = function( container ) { var bubbleHolder = $(document).find('.bubble-holder'),prevIoUsPosition = container.offset().left; bubbleHolder.css('left',prevIoUsPosition); }; return this.each( function() { var $this = $(this),container = getBubbleDiv( $this ); $this.on('mouseenter',animate ); $this.on('mouSEOut',unanimate ); $(window).on('resize',shiftDiv.bind(this,$this) ); return $this.parent().prepend(container); }); }; })(jQuery);

以上给大家分享了js气泡效果的关键步骤,代码简单易懂,就没给写过多的文字说明,大家有疑问欢迎给我留言,小编会及时回复大家的,在此小编也非常感谢大家对编程之家网站的支持

原文链接:https://www.f2er.com/js/49014.html

猜你在找的JavaScript相关文章