Development of large rotary draw with jqueryrotate Rotary plug-in

Source: Internet
Author: User

Objective:

The company originally developed a large rotary draw event with Flash I found SWF file unexpectedly 6m big, scare urine!

In fact, it can be written with JS, but its front-end ability is limited, and time is urgent, so the direct use of rotary plug-in is good, compatible with all aspects can be guaranteed.

1, reference jquery.js, Jqueryrotate.2.2.js plug-in 2, HTML code:
 <  div  style  = "width:480px;margin:0 Auto;height:480px;background:url (http://weixin.maotui.cn/ Web/wechat/dazhuanpan/img/2.png) No-repeat; " >  <  img  id  = "Lotterybtn"   Alt  = ""   src  = "Http://weixin.maotui.cn/web/wechat/dazhuanpan/img/1.png"   style  = "MARGIN:157PX;"  />  </ div  >  
3, JS code:

Parameter: angle: Angle

Duration: Duration

Animateto: Total angle of rotation

Callback: Complete execution of the

Method

Stoprotare (): Stop rotation

The Rotate method is as follows:

<Script>    $("#lotteryBtn"). Click (function () {        varAngle=math.random ()*  the; Angle=Math.ceil (angle);//0 to 360 random integer $ ("#lotteryBtn"). Rotate ({//Rotateangle: -, //AngleDuration:6000, //DurationAnimateto:angle+ 2160, //angle is the angle of each prize in the picture, 2160 is I want the pointer to rotate 6 laps. So the final end of the angle is like this ^ ^Callback:function() {Alert (angle+ "Degree duration 6 seconds turn 6 laps! "); Window.location.href=window.location.href;    }        }); });</Script>

Show Address: Big turntable

Effect:

This article copyright belongs to the author (She Jun) and blog Garden All, welcome reprint, reprint please indicate source.

Original address: http://www.cnblogs.com/net-xiejun/

Development Group

Full source Download: https://github.com/xiejun-net/weixin

Public account:

Development of large rotary draw with jqueryrotate Rotary plug-in

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.