zoukankan      html  css  js  c++  java
  • atitit.自适应设计悬浮图片的大小and 位置


    atitit.自适应设计悬浮图片的大小and 位置

    #--------最好使用relate定位..

    中间,图片的大小和位置走能相对table, 没有遮罩左的或者哈面儿文本的问题,要悬浮,使用top:-15 负值,,

    #--------悬浮位置top的问题,由于相对高度..
    子能使用js解决,计算top负值..

    function iniBonusPicPostion() {
        var mainmainxTop = $("#mainmainx").position().top;
        var mainxHeight = $("#mainmainx").height();
        var hamyarHit = 0.16 * mainxHeight;
        logx("--mainmainxTop n hit:" + mainmainxTop + "--" + mainxHeight);

     ///hamyarHit 走十 relateion时候儿的负值..
     //bonusPicTop 是绝对定位时候儿的top

        var bonusPicTop = mainmainxTop + mainxHeight - hamyarHit;
        logx("--bonusPicTop:" + bonusPicTop);
        $("#bonuspic").css("top", bonusPicTop);

    }

    作者 老哇的爪子 Attilax 艾龙。  EMAIL:1466519819@qq.com
    转载请注明来源: http://blog.csdn.net/attilax


    #-----使用绝对定位麻烦的多多...

    a.遮罩左边文本的问题??

    使用right:5% 解决,,不要使用left 55%的方式..jei个不太ok有时..

    b.遮罩哈面儿文本的问题.

    子能使用js 调整自己主动高度..自己主动缩写高度...

    function iniBonusPicPositionNhit() {
        //ini bonus pic height if too lower
        var bonusPicTop = $("#bonuspic").position().top;
        var bnsPicBtm = bonusPicTop + $("#bonuspic").height();
        var btnDivO5_top = $("#btnDivO5").position().top;
        if (bnsPicBtm <= $("#btnDivO5").position().top) {
            logx("--bnsPicBtm no excel btm boder");
            return;
        }
        var excelHit = bnsPicBtm - btnDivO5_top;
        
        $("#bonuspic").height(btnDivO5_top - $("#bonuspic").position().top-2);
        //if ($("#topDivO5").height() - 5 >= excelHit) {
    //
    //        logx("--topDivO5 hit >> excelHit");
    //        var topDivO5_hit = $("#topDivO5").height();
    //        $("#topDivO5").height(topDivO5_hit - excelHit - 8);
    //        iniBonusPicPostion();
    //        return;
    //    }
    //    $("#topDivO5").height(5);
    //    iniBonusPicPostion();
        

    }
  • 相关阅读:
    PE文件结构详解
    谷歌新工具公布全球网络透明度报告
    ecshop的数据库getRow、getAll、getOne区别
    Vue中正确使用jQuery的方法
    vue 发送ajax请求
    vue使用axios,进行网络请求
    vue组件调用(用npm安装)
    vue组件调用(全局调用和局部调用)
    UE初写小项目问题之命令行报错:Expected indentation of 4 spaces but found 6
    webpack One CLI for webpack must be installed. These are recommended choices, delivered as separate(webpack报错)
  • 原文地址:https://www.cnblogs.com/gccbuaa/p/7009216.html
Copyright © 2011-2022 走看看