Add timestamp to CSS id

I'm working on some css experiments and I'd like the replicate something that is done in Adobe Edge Animate. In that program, you are able to create 100% uniquely named divs that avoid the possibility of running into the same name divs on a website. An example of this is ad-serving any element that requires css. Even if I name something really_cool_container as an id, there is always the chance that I will run into a div with this name, and completely break the entire page. Edge is able to generate your named ids as something like really_cool_container_028485020 for every instance of that container on the page. This goes for two instances of really_cool_container that may appear on the page twice. Edge can be limited in some respects, so I'd like to find a way to add a timestamp value to each instance (down to the ms) in order to reduce the likeliness of running into a similar id. Edge also manages to rename the id, but in all instances of that id so that other scripts can still reference it. Does anyone know how to do this through pure code?

以上就是Add timestamp to CSS id的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准