自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 两个按钮,点击当前按钮后置灰,另一个按钮不变

$(“#submit1”).click(function(){console.log(111)$("#submit1").attr("disabled","true");$('#submit1').css({'background':'#8E8E8E'});$("#submit2").removeAttr("disabled");$('#submit2').css({'backgrou

2018-01-15 15:23:18 1486

原创 jquery实现页面右下角弹框效果

$(document).ready(function(){ var hheight=$(".box").height(); //202是盒子的高度 var theight=hheight-202; // $(".box").css({bottom:-hheight+"px"}); $(".box").animate({bottom:theight+"px"},2

2017-12-05 10:42:57 2504

原创 jquery点击切换图标(比如刷新图标,静态变动态图片)

html:<img class="shuaxin" src="../static/img/break.png">js:$(".shuaxin").click(function(){$(this).attr("src","../static/img/dongtai.gif");});setInterval(function(){ // console.log(123) $(".sh

2017-11-27 09:16:06 4071

原创 jquery实现新闻消息滚动

html代码: <div class="root"> <div class="mainleft"> <span>今日消息</span> </div> <div class="mainright"> <ul> <li>hjkdfhkh-lkj- lkdj开发完成</li>

2017-11-14 11:12:29 4770 1

原创 jquery点击图标来回切换的几种方法(如开关按钮)

1.$(".img").click(function(){ if(this.src.search("../static/img/off.png")!=-1){ this.src="../static/img/on.png"; }else{ this.src="../static/img/off.png" }

2017-09-18 16:33:50 12221

原创 自己用div写一个圆角箭头

<div class="yuan"><</div>css如下:.yuan{ width: .4rem;//.4rem相当于pc端的400px height: .4rem; background: black; color: #fff; font-weight: 700; line-height: .4rem; text-align: cen

2017-09-06 11:32:52 1224

原创 点击图标快速回到页面顶部

$(function () { //当滚动条的位置处于距顶部300像素以下时,跳转链接出现,否则消失 $(function () { $(window).scroll(function () { if ($(window).scrollTop() > 300) { $(".

2017-08-29 09:47:29 1263

原创 js转换成会计字符并逗号隔开保留两位小数,整数后面加.00

function fmoney(s, n) { n = n > 0 && n <= 20 ? n : 2; s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1]; t = ""; for (i

2017-08-28 09:22:37 747

原创 js小数转换百分数并保留两位小数

function toPercent(point){ var str=Number(point*100).toFixed(2); str+="%"; return str;}var point=0.123456;console.log(toPercent(point))最终结果是12.35%

2017-08-28 09:13:58 14533

原创 底部定位,键盘弹出时把底部顶上去的解决方法

原理就是键盘弹起的时候让底部定位的元素隐藏,键盘消失时再显示var oHeight = $(document).height(); //屏幕当前的高度 $(window).resize(function(){ if($(document).height() < oHeight){ $(".footer").css("disp

2017-08-18 15:48:27 2574

原创 输入框弹出输入法高度自适应(遮挡键盘,自动反弹)

$('textarea').on('focus',function(event){ //自动反弹 输入法高度自适应 var target = this; setTimeout(function(){ target.scrollIntoViewIfNeeded(); },100); });

2017-08-18 15:44:51 1519

原创 点击提交按钮,按钮变灰,页面正在加载中

<div class="loading">加载中<img src="img/1.gif" alt=""></div><button>提交</button>js代码: $('button').click(function(){ $('button').attr("disabled","true"); $('button').css({'background':'#8E8E8E'

2017-08-10 11:20:01 3376

原创 提交页面过程中覆盖原页面加灰效果

<div class="hbg"></div>css代码:.hbg { width:100%; position:absolute; background:#000; z-index:998; top:0; left:0; height:100%; opacity:0.7; display: none;}

2017-08-10 10:59:45 291

原创 js小数转换百分数并保留两位小数

// 转换百分数保留两位小数function toPercent(point){ var str=Number(point*100).toFixed(2); str+="%"; return str;}var point=0.123456;console.log(toPercent(point))调用toPercent到页面即可

2017-08-10 10:50:43 12628 1

原创 for循环某个div

var data={ 'date':'2017年3月12日  15点15分15秒', 'people':'买买买', 'jg':'0.32', 'gree':'注意业务风险', 'gg':'' } var objhtml="";for(var j=0;j<4;j++){ objhtm

2017-08-10 10:46:01 5068

原创 js截取url的参数,?号后面参数的几种方法

url参数

2017-08-10 10:30:33 7995 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除