http://www.w2bc.com/article/230591 <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>可创建gooey效果抖动窗口的jquery插件</title> <style type="text/css"> html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; box-sizing: border-box; } h1{text-align: center;margin: 100px auto 10px} .clear { clear: both; height: 0; font-size: 0; line-height: 0; } #holder{ width:480px; height:480px; position:relative; background-color: #297fb8;margin: 30px auto; } #window1 { width:350px; height:110px; left:65px; top:65px; position:absolute; padding: 20px 20px 20px 20px; } #window2 { width:350px; height:110px; left:65px; top:65px; position:absolute; padding: 20px 20px 20px 20px; } </style> </head> <body> <h1>可创建gooey效果抖动窗口的jquery插件 <span>A jQuery plugin applies a wobble effect to your HTML elements backgrounds</span></h1> <div id="holder"> <div id='holder1' style='left:0px; top:0px; width:480px; height:240px; position:absolute; background-color: #f1c40f'> <div id='window1'> <strong>Lorem ipsum</strong> dolor sit amet, consectetur adipiscing elit. Fusce ac elementum tortor, eget efficitur quam. </div> </div> <div id='holder2' style='left:0px; top:240px; width:480px; height:240px; position:absolute; background-color: #f39c11'> <div id='window2'> <strong>Lorem ipsum</strong> dolor sit amet, consectetur adipiscing elit. Fusce ac elementum tortor, eget efficitur quam. </div> </div> </div> <script src="http://cdn.bootcss.com/jquery/1.11.0/jquery.min.js" type="text/javascript"></script> <script src='http://img.gzui.net/plug-in/jquery.wobblewindow.min.js'></script> <script> $( document ).ready( function() { //------------------------------------------------------------------------ //Settings - params for WobbleWindow var settings = { bodyColor: '#EEE', numberOfXPoints: 7, numberOfYPoints: 3 }; //------------------------------------------------------------------------ //standalone //init var wobbleWindow1 = new WobbleWindow( document.getElementById( 'window1' ), settings ); var wobbleWindow2 = new WobbleWindow( document.getElementById( 'window2' ), settings ); //------------------------------------------------------------------------ //jQuery //init // $( '#window1' ).wobbleWindow( settings ); // $( '#window2' ).wobbleWindow( settings ); //------------------------------------------------------------------------ } ); </script> </body> </html> 提示:你可以先修改部分代码再运行。 转载请注明:有爱前端 » 可创建gooey效果抖动窗口的jquery插件 喜欢 (0)or分享 (0)