RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
jQuery如何实现炫丽的3d旋转星空效果

这篇文章给大家分享的是有关jQuery如何实现炫丽的3d旋转星空效果的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

成都创新互联公司拥有一支富有激情的企业网站制作团队,在互联网网站建设行业深耕十载,专业且经验丰富。十载网站优化营销经验,我们已为成百上千中小企业提供了网站制作、成都做网站解决方案,定制设计,设计满意,售后服务无忧。所有客户皆提供一年免费网站维护!

该特效也是在Jquery插件库中找到的,感觉效果不错,说不定以后项目中要有绚丽的星空背景,拿来即用,收藏了下。

下载解压后的目录结构

jQuery如何实现炫丽的3d旋转星空效果

index.html页面代码:




  
   
  
  jQuery和CSS3超绚丽的3D星空动画特效
  
  body {
   background: radial-gradient(200% 100% at bottom center, #0070aa, #0b2570, #000035, #000);
   background: radial-gradient(220% 105% at top center, #000 10%, #000035 40%, #0b2570 65%, #0070aa);
   background-attachment: fixed;
   overflow: hidden;
  }
  @keyframes rotate {
   0% {
    transform: perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(0);
   }
   100% {
    transform: perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(-360deg);
   }
  }
  .stars {
   transform: perspective(500px);
   transform-style: preserve-3d;
   position: absolute;
   bottom: 0;
   perspective-origin: 50% 100%;
   left: 50%;
   animation: rotate 90s infinite linear;
  }
  .star {
   width: 2px;
   height: 2px;
   background: #F7F7B6;
   position: absolute;
   top: 0;
   left: 0;
   transform-origin: 0 0 -300px;
   transform: translate3d(0, 0, -300px);
   backface-visibility: hidden;
  }
  


  
  
     

运行的效果如下:

jQuery如何实现炫丽的3d旋转星空效果

其中stopExecutionOnTimeout.js如下:

"use strict";"object"!=typeof window.CP&&(window.CP={}),window.CP.PenTimer={programNoLongerBeingMonitored:!1,timeOfFirstCallToShouldStopLoop:0,_loopExits:{},_loopTimers:{},START_MONITORING_AFTER:2e3,STOP_ALL_MONITORING_TIMEOUT:5e3,MAX_TIME_IN_LOOP_WO_EXIT:2200,exitedLoop:function(o){this._loopExits[o]=!0},shouldStopLoop:function(o){if(this.programKilledSoStopMonitoring)return!0;if(this.programNoLongerBeingMonitored)return!1;if(this._loopExits[o])return!1;var t=this._getTime();if(0===this.timeOfFirstCallToShouldStopLoop)return this.timeOfFirstCallToShouldStopLoop=t,!1;var i=t-this.timeOfFirstCallToShouldStopLoop;if(ithis.STOP_ALL_MONITORING_TIMEOUT)return this.programNoLongerBeingMonitored=!0,!1;try{this._checkOnInfiniteLoop(o,t)}catch(n){return this._sendErrorMessageToEditor(),this.programKilledSoStopMonitoring=!0,!0}return!1},_sendErrorMessageToEditor:function(){try{if(this._shouldPostMessage()){var o={action:"infinite-loop",line:this._findAroundLineNumber()};parent.postMessage(JSON.stringify(o),"*")}else this._throwAnErrorToStopPen()}catch(t){this._throwAnErrorToStopPen()}},_shouldPostMessage:function(){return document.location.href.match(/boomerang/)},_throwAnErrorToStopPen:function(){throw"We found an infinite loop in your Pen. We've stopped the Pen from running. Please correct it or contact support@codepen.io."},_findAroundLineNumber:function(){var o=new Error,t=0;if(o.stack){var i=o.stack.match(/boomerang\S+:(\d+):\d+/);i&&(t=i[1])}return t},_checkOnInfiniteLoop:function(o,t){if(!this._loopTimers[o])return this._loopTimers[o]=t,!1;var i=t-this._loopTimers[o];if(i>this.MAX_TIME_IN_LOOP_WO_EXIT)throw"Infinite Loop found on loop: "+o},_getTime:function(){return+new Date}},window.CP.shouldStopExecution=function(o){return window.CP.PenTimer.shouldStopLoop(o)},window.CP.exitedLoop=function(o){window.CP.PenTimer.exitedLoop(o)};

效果还是挺不错的,你可以改变背景颜色等等定制。

jquery是什么

jquery是一个简洁而快速的JavaScript库,它具有独特的链式语法和短小清晰的多功能接口、高效灵活的css选择器,并且可对CSS选择器进行扩展、拥有便捷的插件扩展机制和丰富的插件,是继Prototype之后又一个优秀的JavaScript代码库,能够用于简化事件处理、HTML文档遍历、Ajax交互和动画,以便快速开发网站。

感谢各位的阅读!关于“jQuery如何实现炫丽的3d旋转星空效果”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!


分享文章:jQuery如何实现炫丽的3d旋转星空效果
当前地址:http://sczitong.cn/article/pjcpdo.html