CodePen

HTML

            
              <div id="movingdiv">
 <a href="#" onclick="toggle()">Click Me!</a>
</div>
            
          
!
via HTML Inspector

CSS

            
              body { background-color: #ffffff; }
#movingdiv {
	overflow: hidden;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	background-color: gray;
	-webkit-transition-duration: 0.3s;
	-moz-transition-duration: 0.3s;
	-o-transition-duration: 0.3s;
	transition-duration: 0.3s;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              function toggle () {

	var el = document.getElementById("movingdiv");
	if ( el.style.marginLeft="250px" ) {

		el.style.marginLeft="250px";

	}

	else {

		el.style.marginLeft="0px";

	}

}
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................