fideasray官网总结

一、用到的jq

1.获取当前点击的元素

	 $(document).click(function  (e) {
	 	var e_id= $(e.target).attr('id');
	 })

2.几秒之后执行动作

setTimeout(function  () {
             btn.removeAttribute('disabled');
              window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=activity.com.packetvision';
  },2000);

3.获取页面路径,截取路径,根据页面更改页面内容

// 获取页面地址
		var pagePath = window.location.href;
		var indexL = pagePath.lastIndexOf("\/")+1;
		var indexR = pagePath.lastIndexOf("\.");

		str = pagePath.substring(indexL,indexR);
		
		// 获取页面宽度
		var pageWidth = $(window).width();
		var imgPath;
		if (pageWidth>767) {
			// 手机
			imgPath = "/fbook/Public/Home/img/website/"+str+".jpg";
		}else{
			// PCbanner
			imgPath = "/fbook/Public/Home/img/website/"+str+"-xs.jpg";
		}
		$("#bannerImg").attr('src',imgPath);

3.css矩阵动画

.article-title{text-align: center;padding-bottom: 20px;visibility: hidden;opacity: 0;transform: matrix(0.9, 0, 0, 0.9, 0, 10);-webkit-transition: all 1s;-moz-transition: all 1s;-ms-transition: all 1s;}
.article-title.title-show{visibility: inherit;opacity: 1;transform: matrix(1, 0, 0, 1, 0, 0);}
// 滑动出现动画
                function titleMatrixShow(object){
                    var titleOffTop = object.offset().top-750;
                    $(window).scroll(function(){
                        if ( $(window).scrollTop()>=titleOffTop) {
                            console.log(1);
                            object.addClass('title-show');
                        }
                    })
                }
titleMatrixShow($('.artical-wrap .article-title-one'));





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值