我有有一个子类中的ID。我想ID过渡,但不类过渡。由于类是id内它正在转变。我已经通过CSS jQuery的文档看了一下,从我想通了如何转型这两个元素,但不能单独过渡父。
这是CSS
#outside {
background-size: 25em, 25em, auto, cover;
color: white;
cursor: default;
padding: 6em 0;
text-align: center;
}
#outside .inside {
background: rgba(52, 27, 43, 0.5);
color: white;
display: inline-block;
opacity: 0;
padding: 3em;
text-align: center;
}
这是我在让jQuery的工作尝试
<script>
$(document).ready(function() {
var timeToDisplay = 4000;
var outside = $('#outside');
var urls = [
'images/image1.jpg',
'images/image2.jpg',
'images/image3.jpg'
];
var index = 0;
var transition = function() {
var url = urls[index];
outside.css('background-image', 'url("images/light-bl.svg"), url("images/light-br.svg"), url(' + url + ')');
index = index + 1;
if (index > urls.length - 1) {
index = 0;
}
};
var run = function() {
transition();
outside.fadeIn('slow', function() {
setTimeout(function() {
outside.fadeOut('slow', run);
}, timeToDisplay);
});
}
$("div.inside").css("-webkit-transition","none !important;");
$("div.inside").css("-moz-transition","none !important;");
$("div.inside").css("-ms-transition","none !important;");
$("div.inside").css("transition","none !important;");
run();
});
</script>
如何var outside = $('#outside:not(.inside)');
?