<cite id="uab1u"></cite><rp id="uab1u"><nav id="uab1u"></nav></rp>
  1. <tt id="uab1u"><form id="uab1u"><delect id="uab1u"></delect></form></tt><tt id="uab1u"><form id="uab1u"><delect id="uab1u"></delect></form></tt>
  2. <tt id="uab1u"><noscript id="uab1u"><delect id="uab1u"></delect></noscript></tt>
  3. js代碼_js特效免費下載_JS特效代碼網   網頁特效   鼠標特效   js圖片相冊   js特效代碼大全
    當前位置:首頁 > 網頁特效 > JS常用代碼 > 圖片相冊

    jquery實現圖片放大鏡插件,鼠標懸停局部圖片放大鏡頭顯示特效

    發布時間:2015-09-05 23:01:41    您是第0位瀏覽者

    本js特效代碼兼容:ie6 、ie7 、ie8 、ie9 、ie10 、ie11 、chrome 、firefox 、opera 、safari 、 等瀏覽器

    jquery實現圖片放大鏡插件,鼠標懸停局部圖片放大鏡頭顯示特效
    (function ($) {
        $.fn.imageLens = function (options) {
    
            var defaults = {
                lensSize: 100,
                borderSize: 4,
                borderColor: "#888"
            };
            var options = $.extend(defaults, options);
            var lensStyle = "background-position: 0px 0px;width: " + String(options.lensSize) + "px;height: " + String(options.lensSize)
                + "px;float: left;display: none;border-radius: " + String(options.lensSize / 2 + options.borderSize)
                + "px;border: " + String(options.borderSize) + "px solid " + options.borderColor 
                + ";background-repeat: no-repeat;position: absolute;";
    
            return this.each(function () {
                obj = $(this);
    
                var offset = $(this).offset();
    
                // Creating lens
                var target = $("<div style='" + lensStyle + "' class='" + options.lensCss + "'>&nbsp;</div>").appendTo($(this).parent());
                var targetSize = target.size();
    
                // Calculating actual size of image
                var imageSrc = options.imageSrc ? options.imageSrc : $(this).attr("src");
                var imageTag = "<img style='display:none;' src='" + imageSrc + "' />";
    
                var widthRatio = 0;
                var heightRatio = 0;
    
                $(imageTag).load(function () {
                    widthRatio = $(this).width() / obj.width();
                    heightRatio = $(this).height() / obj.height();
                }).appendTo($(this).parent());
    
                target.css({ backgroundImage: "url('" + imageSrc + "')" });
    
                target.mousemove(setPosition);
                $(this).mousemove(setPosition);
    
                function setPosition(e) {
    
                    var leftPos = parseInt(e.pageX - offset.left);
                    var topPos = parseInt(e.pageY - offset.top);
    
                    if (leftPos < 0 || topPos < 0 || leftPos > obj.width() || topPos > obj.height()) {
                        target.hide();
                    }
                    else {
                        target.show();
    
                        leftPos = String(((e.pageX - offset.left) * widthRatio - target.width() / 2) * (-1));
                        topPos = String(((e.pageY - offset.top) * heightRatio - target.height() / 2) * (-1));
                        target.css({ backgroundPosition: leftPos + 'px ' + topPos + 'px' });
    
                        leftPos = String(e.pageX - target.width() / 2);
                        topPos = String(e.pageY - target.height() / 2);
                        target.css({ left: leftPos + 'px', top: topPos + 'px' });
                    }
                }
            });
        };
    })(jQuery);



    放大鏡

    jqzoom仿京東商品詳細頁產品圖片放大鏡特效

    jquery仿淘寶圖片放大鏡特效

    jquery實現圖片放大鏡插件,鼠標懸停局部圖片放大鏡頭顯示特效

    jquery實現圖片放大鏡效果制作變焦鏡頭圖片放大查看特效

    jquery實現input表達輸入文字,文字放大鏡特效

    js實現圖片放大鏡展示特效代碼

    jQuery商城網站商品放大鏡查看效果特效代碼

    js放大鏡 _jquery圖片放大鏡特效插件_移動鼠標圖片特效代碼_商城源碼

    青海快3 www.hollyflicks.com:光山县| www.happy-pie.com:外汇| www.qjlvyou.com:东光县| www.f3n3.com:仙居县| www.merrtoshop.com:西丰县| www.ph581.com:商河县| www.mftdq.com:包头市| www.mmn2015.org:阿拉善左旗| www.f5862.com:仙游县| www.cosplay-world.net:黄陵县| www.pikaglass.com:武义县| www.hautdeals.com:宜兰市| www.zhimeijie.com:阜新| www.nnxrlt.com:牡丹江市| www.vcmarienkirchen.com:崇信县| www.katherineboliek.com:荆州市| www.102371.com:渝北区| www.uniahes.com:白银市| www.livewellfeelgood.com:治县。| www.yzabtattoo.com:贡嘎县| www.421zj.com:林甸县| www.otunetwork.com:项城市| www.hiroshihawaii.com:龙岩市| www.eeece.org:高陵县| www.sandillc.com:叙永县| www.ziti1.com:砀山县| www.heritage-academy.org:静乐县| www.lw338.com:体育| www.bjgyxw.com:弋阳县| www.gzgwg.com:绿春县| www.magazintelevizyonu.com:榆林市| www.cp7892.com:台北县| www.dag9.com:江都市| www.gondex.com:东山县| www.w-wha.org:亳州市| www.minamihompi.com:十堰市| www.wwwwmw.com:武鸣县| www.zhjuzi.com:华池县| www.mastersengenharia.com:临汾市| www.hg10456.com:万盛区| www.shunda-steel.com:墨玉县| www.yirongjie.com:平塘县| www.cskurumsaltuketim.com:曲阳县| www.wyadorkable.com:虹口区| www.saybelfld.com:景宁| www.clickablevideoads.com:陇川县| www.mydzs.com:古蔺县| www.ningmengwl.com:高安市| www.gearsexporters.com:太谷县| www.090633.com:江城| www.suixicom.com:正宁县| www.zjxklpme.com:黎川县| www.cp2205.com:南雄市| www.9zmm.com:灌南县| www.com51job.com:界首市| www.zydzqj.cn:章丘市| www.threecrownsracing.com:永兴县| www.allnaturessafeway.com:阿瓦提县| www.hangangcamp.com:婺源县| www.david-bird.com:铜鼓县| www.zhiweifurniture.com:寿光市| www.305182.com:利津县| www.uggaugga.com:吉安县| www.krntz.com:宁河县| www.supernac.com:本溪| www.zjoydq.com:犍为县| www.lnkqxx.com:连江县| www.hannahchungportfolio.com:永春县| www.dogalviagra.com:青龙| www.joikoi.com:图们市| www.823352.com:保定市| www.nest180.com:阿克苏市| www.bichengdecoration.com:海口市| www.coolvier.com:隆德县| www.52nnt.com:顺昌县| www.anoscampagnes.com:武鸣县| www.yjttw.cn:浠水县| www.dawntoner.com:九寨沟县| www.zjyxgs.com:武穴市| www.sxsz.org:集安市| www.hdneyo.com:周口市| www.edongphoto.com:新乡市| www.5005560.com:盐亭县| www.thesokolcompany.com:京山县|