国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術(shù)文章
文章詳情頁

jquery - css3 scale 縮放圖片問題

瀏覽:138日期:2023-07-16 14:53:09

問題描述

我想點(diǎn)擊document讓p的圖片從中心點(diǎn)向兩邊展開一張圖片的大小用了css3的縮放,但是他會(huì)把圖片弄失真,問下用css3能否實(shí)現(xiàn)

<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <title>Document</title> <style>p { width:1px; background:url(http://www.ppt123.net/beijing/UploadFiles_8374/201203/2012032518062306.jpg); background-size:cover; height:600px; margin:100px auto; -webkit-transform-origin:left top; -moz-transform-origin:left top; -o-transform-origin:left top; -ms-transform-origin:left top; transform-origin:left top; -webkit-transition:1s; -moz-transition:1s; -o-transition:1s;} </style></head><body> <p class='outter'></p> <script src='http://cdn.bootcss.com/jquery/2.2.1/jquery.js'></script> <script>$(function() { $(document).on(’click’,function(){ $(’p’).css({ ’-webkit-transform’:’scaleX(800)’,’transform’:’scaleX(800)’ }) })}); </script></body></html>

問題解答

回答1:方法一:js

<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <title>Document</title> <style>p { width:0; height:0;position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: 50% 50%;background:url(http://www.ppt123.net/beijing/UploadFiles_8374/201203/2012032518062306.jpg); background-size:cover;} </style></head><body> <p class='outter'></p> <script src='http://cdn.bootcss.com/jquery/2.2.1/jquery.js'></script> <script>$(function() { $(document).on(’click’,function(){ $(’p’).stop(true).animate({ width: 800, height: 600 }) })}); </script></body></html>方法二:scale

<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <title>Document</title> <style>p { width: 800px; height: 600px; margin: 100px auto 0; transform: scale(0); transform-origin: 50% 50%; transition: transform .4s ease-in-out; background:url(http://www.ppt123.net/beijing/UploadFiles_8374/201203/2012032518062306.jpg); background-size:cover;} </style></head><body> <p class='outter'></p> <script src='http://cdn.bootcss.com/jquery/2.2.1/jquery.js'></script> <script>$(function() { $(document).on(’click’,function(){ $(’p’).css({ 'transform': 'scale(1)' }) })}); </script></body></html>方法三:純CSS

<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <title>Document</title> <style>.outter { width: 800px; height: 600px; margin: 100px auto 0; background-color: gray;}.inner { width: 800px; height: 600px; transform: scale(0); transform-origin: 50% 50%; transition: transform .4s ease-in-out; background:url(http://www.ppt123.net/beijing/UploadFiles_8374/201203/2012032518062306.jpg); background-size:cover;}.outter:hover .inner { transform: scale(1);} </style></head><body> <p class='outter'><p class='inner'></p> </p></body></html>回答2:

你的圖片是位圖,放大肯定會(huì)失真,你要用矢量圖。你用css3也可以實(shí)現(xiàn),要用高版本的瀏覽器。但是圖片照樣會(huì)失真。

回答3:

你只放大x肯定失真。。模糊的話需要用矢量的

標(biāo)簽: CSS
相關(guān)文章:
主站蜘蛛池模板: 欧美jizzhd精品欧美高清 | 亚洲另类视频在线观看 | 中文字幕欧美日韩一 | 午夜三级毛片 | 国产手机精品视频 | 国产亚洲精品激情一区二区三区 | 99久久精品国产综合一区 | 免费va国产高清不卡大片 | 久久www免费人成看国产片 | 欧美性欲视频 | 成人性动漫高清免费观看网址 | 久久99久久精品免费思思 | 亚洲精品一区二区久久 | 黄色三级网址 | 欧美日韩国产一区二区三区播放 | 我想看三级特黄 | 日韩欧美一区二区三区免费观看 | 亚洲99在线的 | 国产自在自线午夜精品视频 | 99在线热播精品免费 | 99爱在线观看精品视频 | xo欧美性另类 | 狠狠色丁香婷婷久久综合不卡 | 成人二区| 欧美大片毛片aaa免费看 | 手机看福利片 | 亚洲欧洲国产成人精品 | 国产精品系列在线一区 | 婷婷色综合久久五月亚洲 | 日本高清在线中文字幕网 | 午夜爽视频 | 国产高清天干天天视频 | 精品一区二区三区高清免费不卡 | 男女视频在线看 | 亚洲国产精品国产自在在线 | 韩国一级永久免费观看网址 | 在线精品一区二区三区 | 国产日韩精品一区在线观看播放 | 免费a级毛片大学生免费观看 | 99精品这里只有精品高清视频 | 一级a俄罗斯毛片免费 |