简体   繁体   English

CSS3动画Z索引越野车?

[英]Css3 animation z-index buggy?

I have been experimenting with css3 animations lately. 我最近一直在尝试css3动画。 I was noticing that it seems as though it is not possible to place html elements over css3 animations using z-index. 我注意到,似乎不可能使用z-index将html元素放置在css3动画上。

Here's my fiddle: http://jsfiddle.net/arcco96/tkwdqqq3/2/ 这是我的小提琴: http : //jsfiddle.net/arcco96/tkwdqqq3/2/

It could be that I am creating the element dynamically. 可能是我正在动态创建元素。

Heres the jquery: 继承人的jQuery:

var cv = $('.container').width();
var side = (.80 * cv);

$("#btn1").click(function() {
  jQuery('<div/>', {
    class: 'timer',
  }).appendTo('#center');

  var cw = $('.timer').width();
  $('.timer').css({
    'height': cw + 'px'
  });


  jQuery('<div/>', {
    class: 'mask',
  }).appendTo('.timer');

  jQuery('<a/>', {
    class: 'round-button',
    href: 'http://example.com',
  }).appendTo('.center');

  $('.round-button').css({
    'height': (cw - 20) + 'px',
    'width': (cw - 20) + 'px'
  });
});

(I eventually want the button to be on top of the timer.) (我最终希望按钮位于计时器顶部。)

If there's a work around I would like to hear it. 如果周围有工作,我想听听。

Sorry, it was in the Fiddle. 抱歉,在小提琴中。

#btn1 {
   position: absolute;
   top: 50%;
   left: 50%;
   width: 100px;
   margin: -1em 0 0 -50px;
  z-index: 9999999;
}

try this 尝试这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM