})
if (parseFloat($(".bri").css("left")) < 0){
$(".bri").css("left","0");
// console.log("kk");
} else if (parseFloat($(".bri").css("left")) >= parseFloat($(this).width() - $(".bri").width())){
// alert("kk");
$(".bri").css("left",$(this).width() - $(".bri").width());
}
if (parseFloat($(".bri").css("top")) < 0) {
$(".bri").css("top", "0");
} else if (parseFloat($(".bri").css("top")) >= parseFloat($(this).height() - $(".bri").height())) {
// alert("kk");
$(".bri").css("top", $(this).height() - $(".bri").height());
}
console.log($(".img").css("background"))
// 放大倍数
let num = 4;
let left = -num * parseFloat($(".bri").css("left"));
let top = -num * parseFloat($(".bri").css("top"));
// console.log($(".bri").css("left"))
$(".big").css({
"background-size": num*100+"%",
"background-position":left+"px " +top+"px",
"display":"block"
// "background": $(".img").css("background")
});
})
})
$(".img").mouseout(function (e) {
$(".big").css({
"display": "none"
// "background": $(".img").css("background")
});
})
更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery常用插件及用法总结》、《jQuery表格(table)操作技巧汇总》、《jQuery拖拽特效与技巧总结》、《jQuery扩展技巧总结》、《jQuery常见经典特效汇总》及《jquery选择器用法总结》
希望本文所述对大家jQuery程序设计有所帮助。










