首页 > 语言 > JavaScript > 正文

基于jQuery插件实现环形图标菜单旋转切换特效

2024-05-06 16:20:24
字体:大 中 小
来源:转载
供稿:网友

本文给大家分享一款基于jQuery环形图标旋转切换特效。这是一款鼠标点击图标菜单圆形顺时针或者逆时针旋转切换代码。有需要的小伙伴可以参考下。

feature.presenter.1.5.css

 

 
  1. body { 
  2. margin: 0; 
  3. font-family: Tahoma; 
  4. } 
  5.  
  6. .feature-presenter { 
  7. position: absolute; 
  8. } 
  9.  
  10. .feature-presenter-icon { 
  11. background-color: white; 
  12. text-align: center; 
  13. transition: transform 0.7s cubic-bezier(0.445, 0.05, 0.55, 0.95); 
  14. -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.445, 0.05, 0.55, 0.95); 
  15. border-radius: 50%; 
  16. cursor: pointer; 
  17. } 
  18.  
  19. .feature-presenter img { 
  20. max-width: 100%; 
  21. transition: transform 0.7s cubic-bezier(0.445, 0.05, 0.55, 0.95); 
  22. -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.445, 0.05, 0.55, 0.95); 
  23. border-radius: 50%; 
  24. cursor: pointer; 
  25. box-shadow: 0 0 16px rgba(0, 0, 0, 0.1); 
  26. filter: blur(0px); 
  27. -webkit-filter: blur(0px); 
  28. image-rendering: -webkit-optimize-contrast; 
  29. } 
  30.  
  31. .feature-presenter i { 
  32. font-size: 85px; 
  33. /*filter: url('data:image/svg+xml;utf8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><filter id="gaussian_blur"><feGaussianBlur in="SourceGraphic" stdDeviation="0" /></filter></defs></svg>#gaussian_blur');*/ 
  34. } 
  35.  
  36. .feature-presenter-circle-container { 
  37. border-radius: 50%; 
  38. display: inline-block; 
  39. border: 1px solid rgba(0,0,0,0.09); 
  40. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.09); 
  41. transition: transform 0.7s cubic-bezier(0.445, 0.05, 0.55, 0.95); 
  42. -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.445, 0.05, 0.55, 0.95); 
  43. background-color: white; 
  44. } 
  45.  
  46. .feature-presenter-text-container { 
  47. line-height: 1.3; 
  48. display: inline-block; 
  49. vertical-align: top; 
  50. z-index: 1001; 
  51. position: relative; 
  52. overflow: hidden; 
  53. } 
  54.  
  55. .feature-presenter-text-heading { 
  56. -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.075, 0.82, 0.165, 1); 
  57. transition: transform 0.4s cubic-bezier(0.075, 0.82, 0.165, 1); 
  58. margin-bottom: 10px; 
  59. color: rgba(0, 0, 0, 0.8); 
  60. } 
  61.  
  62. .feature-presenter-text-description { 
  63. -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.075, 0.82, 0.165, 1) 0.4s; 
  64. transition: transform 0.4s cubic-bezier(0.075, 0.82, 0.165, 1) 0.4s; 
  65. color: rgba(0, 0, 0, 0.5); 
  66. } 
  67.  
  68. .feature-presenter-text-container-out { 
  69. -webkit-transform: translate(200%, 0); 
  70. transform: translate(200%, 0); 
  71. -webkit-transition: -webkit-transform 0.5s ease-in; 
  72. transition: transform 0.5s ease-in; 
  73. } 

html:

 

 
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3. <head> 
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  5. <title>基于jQuery环形图标菜单旋转切换特效</title> 
  6. <link href='css/feature.presenter.1.5.css' rel='stylesheet' type='text/css'> 
  7. <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script> 
  8. </head> 
  9. <body> 
  10. <div id="test-element"></div> 
  11. <script src="js/feature.presenter.1.5.min.js"></script> 
  12. <script> 
  13. /* 图片地址可以是相对路径或绝对路径;标题和描述可以包含HTML */ 
  14. var settings = [ {image: 'images/zzsc1.png', heading: '武林网', description: 'www.vevb.com'}, 
  15. { image: 'images/zzsc2.png', heading: '武林网', description: 'www.vevb.com' }, 
  16. { image: 'images/zzsc3.png', heading: '武林网', description: 'www.vevb.com' }, 
  17. { image: 'images/zzsc4.png', heading: '武林网', description: 'www.vevb.com' }, 
  18. { image: 'images/zzsc5.png', heading: '武林网', description: 'www.vevb.com' }, 
  19. { image: 'images/zzsc6.png', heading: '武林网', description: 'www.vevb.com' } 
  20. ]; 
  21. var options = { 
  22. circle_radius: 220, 
  23. normal_feature_size: 100, 
  24. highlighted_feature_size: 150, 
  25. top_margin: 100, 
  26. bottom_margin: 50, 
  27. spacing: 40, 
  28. min_padding: 50, 
  29. heading_font_size: 30, 
  30. description_font_size: 20, 
  31. type: 'image' 
  32. }; 
  33. var fp = new FeaturePresenter($("#test-element"), settings, options); 
  34. fp.createPresenter(); 
  35. </script> 
  36. </body> 
  37. </html> 

以上所述就是本文的全部内容了,希望大家能够喜欢。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选