html鼠标悬停左侧缩小图片放大到右边

html鼠标悬停左侧缩小图片放大到右边,第1张

html鼠标悬停左侧缩小图片放大到右边

首先这是一张图片在悬停时放大也就是改变大小(宽,高)实现的。

2,一张图片在放大的时候会根据其定位(如在div里面的图片会以div的左上角为基准扩大宽和高)来放大的,因此如果我们不去为图片添加相对定位并且不去调节扩大后的位置,他的放大会是向一边的,因此我们必须考虑其放大后的位置。

3,放大的效果是要用动画实现的。

代码:html>

尝试

.a1{width:137pxheight:138pxborder:1px solid redoverflow:hiddenposition:relative}

.pic{position:absolute}

$(function(){

$w = $('.pic').width()

$h = $('.pic').height()

$w2 = $w + 20

$h2 = $h + 20

$('.pic').hover(function(){

$(this).stop().animate({height:$h2,width:$w2,left:"-10px",top:"-10px"},500)

},function(){

$(this).stop().animate({height:$h,width:$w,left:"0px",top:"0px"},500)

})

})

arcgis的htmld出窗口图片缩小方法如下。

1、首先打开软件,在软件中给制作的地图添加一个图框,可以看到图框大小,在界面左上角找到File选项并点击,在其下拉框中选择PageandPrintSetup选项。

2、界面上会d出一个PageandPrintSetup窗口,在窗口中找到UsePrinterPaperSettings选项,点击该选项,使其前面小方框中的勾消失即可。

html图片按屏幕大小等比例缩放若浏览器允许可按Ctrl+鼠标滚轮滑动缩放,或用代码。

具体方法如下:

Ctrl+鼠标滚轮滑动缩放

css代码与htlm代码

CSS 代码如下:

#background

{

position: fixed

top: 0

left: 0

width: 100%

height: 100%

overflow: hidden

background-color: #211f1f

display:none\8

}

#background .bg-photo

{

position: absolute

top: 0

left: 0

width: 100%

height: 100%

display: none

overflow: hidden

-webkit-background-size: cover !important

-moz-background-size: cover !important

-o-background-size: cover !important

background-size: cover !important

}

#background .bg-photo-1

{

background: url('../image/alone.jpg') no-repeat center center

}

#background-ie {

position: fixed

top: 0

left: 0

width: 100%

height: 100%

overflow: hidden

background-color: #211f1f

}

HTML代码如下:

<div id="background">

<div class="bg-photo bg-photo-1" style="display: block"></div>

</div>

参考资料

html 网页背景图片根据屏幕大小CSS自动缩放.CSDN博客[引用时间2017-12-29]


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/7296208.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-04
下一篇2023-04-04

发表评论

登录后才能评论

评论列表(0条)

    保存