Currently, I am attempting to implement the code for ramjet from . However, I am facing an issue where element a does not disappear when transitioning into b. Additionally, I am encountering an error message "--Uncaught TypeError: Cannot read property 'add' of undefined--", even though element a does move. Can someone provide guidance on how to achieve the transformation of a into b, as demonstrated on the provided page?
Script.js
$(document).ready( function() {
// setting the stage for ramjet to copy the correct styles...
b.classList.remove('hidden');
ramjet.transform( a, b, {
done: function () {
// this function is executed right after the transition is complete
b.classList.remove('hidden');
}
});
// ...then hiding the original elements during the transition
a.classList.add('hidden');
b.classList.add('hidden');
});
index.html
<!DOCTYPE HTML>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="./ramjet.js"></script>
<script type="text/javascript" src="./script.js"></script>
</head>
<body>
<div class="back">
<div id="a"></div>
<div id="b" class="hidden"></div>
</div>
</body>
</html>
stylesheet.css
.back {
float: left;
width: 790px;
height: 525px;
border-radius: 5px;
background-color: #BCD2EE
}
#a {
margin: 200px 10px;
margin-right: auto;
width: 175px;
height: 60px;
background-color: #666699;
display: inline-block;
position: relative;
border: 2px solid black;
}
#b {
margin: 200px 10px;
margin-right: auto;
width: 175px;
height: 60px;
background-color: red;
display: inline-block;
position: relative;
border: 2px solid black;
}
.hidden {
visibility: hidden;
}