为什么过渡中的幻灯片不起作用,而幻灯片中的幻灯片却起作用呢?

时间:2020-05-06 15:26:25

标签: javascript html css

当我单击“复制”按钮时,我希望“文本复制”的div滑入,然后我希望它再次滑出,但它只是滑出,我不知道为什么。我没有尝试进行任何修复,因为我想不出任何可能出错的地方,我将非常感谢您的帮助,感谢您抽出宝贵的时间阅读本文,我的代码在下面

const Discord = require('discord.js');
function myFunction(){
  var text = document.getElementById('input').value;
  var textArray = text.split(" ").sort();
  var output= document.getElementById('output');
  output.value = textArray.toString().replace(/,/g," ");
}

function maFunction() { //update : el
  //el.classList.add('clicked');// update 
  /*document.getElementById('foo').innerHTML = 'text copied!';
  document.getElementById("foo").classList.add("mystyle");*/
  var copyText = document.getElementById("output");
  copyText.select();
  copyText.setSelectionRange(0, 99999)
  document.execCommand("copy");
  document.getElementById("notify").classList.replace("one","two");
}

function right() {
  //document.getElementById("foo").classList.replace("mystyle","o");
  document.getElementById("notify").classList.replace("two","one");
}

/*function back() {
document.getElementById('foo').innerHTML = 'click to copy text';
}

function ok() {
  document.getElementById("copied").innerHTML = "Hello World";
}*/

/*function fadeOut(){
 location.href='index.html#open-modal';
 setTimeout(function () {
     location.href='index.html#modal-close';
     }, 1000);
}*/
body {
    margin-top: 10px;
    margin-left: 20px;
    display: flex;
}

.form {
    margin-right: 20px;
    background: #ffffff;
    position: relative;
    
}

 .input {
    height: 700px;
    width: 600px;
    margin-top: 15px;
    outline: none;
    font-size: 26px;
    resize: none;
    border-style: solid;
    border-color: #4CAF50;
    border-width: 2px;
    outline: none;
    border-radius: 10px;
    margin-top: 0px;
    padding-top: 5px;
    padding-left: 10px;
}

.otput {
    height: 695px;
    width: 620px;
    outline: none;
    resize: none;
    border-style: solid;
    border-color: #4CAF50;
    border-width: 2px;
    border-radius: 10px;
    outline: none;
    margin-left: 10px;
}

 .output {
    height: 650px;
    width: 512px;
    outline: none;
    font-size: 26px;
    resize: none;
    outline: none;
    border: none;
    padding: 0px;
    margin-top: 5px;
    margin-left: 10px;
}

.button {
    background: #4CAF50;
    border: none;
    outline: none;
    color: #ffffff;
    padding: 14px;
    width: 100px;
    border-radius: 0 10px;
    /*margin-left: 1134px;*/
    font-size: 22px;
    cursor: pointer;
    position: absolute;
}

.speech-bubble {
    height: 25px;
    width: 170px;
    color: white;
    font-size: 22px;
    text-align: left;
	position: relative;
	background: #4CAF50;
    border-radius: 1px;
    padding: 10px 5px 10px 7px;
    box-shadow: 0 4px 8px 0 rgba(141, 105, 105, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    /*display: none;*/
    margin-top: 35px;
    margin-left: 630px;
    transform: translateY(-690px);
    opacity: 0;
    transition: opacity 200ms, width 100ms;
    white-space: nowrap;
}

.speech-bubble:after {
    content: '';
	position: absolute;
	left: 0;
	top: 50%;
	width: 0;
	height: 0;
	border: 9px solid transparent;
	border-right-color: #4CAF50;
	border-left: 0;
	margin-top: -9px;
    margin-left: -9px;
}


.button:hover + .speech-bubble {
    opacity: 1;
    /*my second transition effect*/
    /*transition: width 100ms;*/
}

.mystyle {
    width: 120px;
    padding-right: 0px;
}

.button:hover + .speech-bubble:after {
    display: block;
}

.one {
    position: relative;
    background: whitesmoke;
    font-size: 25px;
    text-align: center;
    padding: 15px;
    height: fit-content;
    width: fit-content;
    margin-left: 20px;
    box-shadow: 0 4px 8px 0 rgba(141, 105, 105, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    right: -300px;
    /*opacity: 0;*/
    transition: /*opacity 500ms*/ right 500ms;
}

.two {
    background: whitesmoke;
    font-size: 25px;
    text-align: center;
    padding: 15px;
    height: fit-content;
    width: fit-content;
    margin-left: 20px;
    box-shadow: 0 4px 8px 0 rgba(141, 105, 105, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    /*opacity: 1;*/
    right: 0;
    transition: right 500ms;
}

::selection {
  color: black;
  background: lightblue;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar:hover {
    width: 20px;
}

::-webkit-scrollbar-thumb {
    background: #888;
}


/*.modal-window {
    position: fixed;
    background-color: rgba(200, 200, 200, 0.75);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    transition: all 0.3s;
}

.modal-window:target {
    opacity: 1;
    pointer-events: auto;
}

.modal-window > div {
    width: 170px;
    height: 50px;
    padding: 10px;
    position: relative;
    margin: 10% auto;
    /*padding: 2rem;*/
    /*background: #fff;
    color: #333;
}

.modal-window .copy{
    font-size: 20px;
}*/

0 个答案:

没有答案