是否可以使溢出不被隐藏但只是改变溢出内容的不透明度?
因此,在父div之外的内容部分的不透明度为.5,但保留在父级中的部分是正常的?
这需要JavaScript我假设如果有人能让我走向正确的方向我会非常感激.在我的小提琴中你可以拖动图像. 小提琴
<script type='text/javascript' src='http://code.jquery.com/jquery-1.5.js'></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.js"></script>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$('#img_rnd').resizable();
$('#rnd').draggable({
appendTo: 'body',
start: function(event, ui) {
isDraggingMedia = true;
},
stop: function(event, ui) {
isDraggingMedia = false;
}
});
});//]]>
</script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/cupertino/jquery-ui.css" />
<div id="frame">
<div id="rnd" style="display:inline-block">
<img id="img_rnd" style="border:1px solid red" src="http://blog.stackoverflow.com/audio/stackoverflow-300.png" />
</div>
</div>
<style>
#frame {
height: 500px;
width: 500px;
overflow: hidden;
border: 1px solid black;
}
</style>
Run Code Online (Sandbox Code Playgroud) 有没有办法在同一个元素上同时使用 vmax 和 vmin ,以便我可以创建一个范围来阻止它变小或变大?当我只使用一个时,它会变得很大或很小,我试图限制它两侧的极端。这适用于响应式设计。
<p>Here is some paragraph text at 3 vmin</p>
<h1>Here is some paragraph text at 3 vmin</h1>
<style>
p {font-size: 3vmax;}
h1 {font-size: 3vmin;font-size:4vmax;}
</style>
Run Code Online (Sandbox Code Playgroud) 我正在使用jQuery隐藏并显示其父div的悬停时的div.它的工作原理但唯一的问题是,当你快速地翻转和关闭几次时,它会一次又一次地预先形成淡入淡出,直到它完成它,就像你移动鼠标一样多次.请参阅:http://api.jquery.com/hover/#hover-handlerIn-handlerOut 这是第一个示例的演示,如果你将它们悬停在它们上面几次非常快,那么看你能看出我的意思.
这是我的代码,是否有任何方式使其更加用户友好,而不是自己重复这么多次?
$(function () {
$('.hide').fadeOut("fast");
$( ".fourth" ).hover(
function() {
$( this ).find('.hide').fadeIn("slow"); ;
}, function() {
$( this ).find('.hide').fadeOut("slow");
}
);
<div class="fourth">
<div class="products">
<h4 class="hide"><a href="#">Laern More</a></h4>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)