zoukankan      html  css  js  c++  java
  • jQuery函数 左右抖动效果,用于提示

    Wordpress博客后台登录输入错误的话登录窗口有左右抖动的效果。弄成jQuery函数方便调用(前提已载入jQuery包)

    function shake(o){
        var $panel = $("#"+o);
        box_left = ($(window).width() -  $panel.width()) / 2;
        $panel.css({'left': box_left,'position':'absolute'});
        for(var i=1; 4>=i; i++){
            $panel.animate({left:box_left-(40-10*i)},50);
            $panel.animate({left:box_left+2*(40-10*i)},50);
        }
    }

    shake函数的参数o就是dom元素的ID,一般就是div的ID。shake('panel'); 简单这样调用就能实现左右抖动的效果。。我用来提示 挺好的

  • 相关阅读:
    阿里云物联网 .NET Core 客户端 | CZGL.AliIoTClient:8. 委托事件
    阿里云物联网 .NET Core 客户端 | CZGL.AliIoTClient:7. 服务调用
    Git
    Git
    Git
    Git
    Git
    Git
    Git
    Delphi
  • 原文地址:https://www.cnblogs.com/see7di/p/2239787.html
Copyright © 2011-2022 走看看