Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.



var toggle;

  window.onload = cycle;

  function cycle() {
    if (!toggle) {
        toggle = window.setInterval(snapvisual,1000);
    } else {
        toggle = null;

function snapvisual (){
	// store thumbnail images
	var r_thumbnail = new Array ();
	r_thumbnail[0] = "";
	r_thumbnail[1] = "";
	r_thumbnail[2] = "";
	r_thumbnail[3] = "";
	r_thumbnail[4] = "";

	var i = Math.floor(r_thumbnail.length * Math.random());

	var r_url = new Array ();
	// store URL to video
	r_url[0] = "";
	r_url[1] = "";
	r_url[2] = "";
	r_url[3] = "";
	r_url[4] = "";

	// store background colour
	var r_bgcolorlist = new Array ();
	r_bgcolorlist[0] = "#228B22";
	r_bgcolorlist[1] = "#FFD700";
	r_bgcolorlist[2] = "red";
	r_bgcolorlist[3] = "blue";
	r_bgcolorlist[4] = "#FFFFFF";

	// replace[i];
	document.getElementById("myImg").src = r_thumbnail[i];
	document.getElementById("myURL").href = r_url[i];
// ---------------------------------- END: AUTO CYCLE VERSION 2 ----------------------------------

<div class="cursor">
<button onclick="cycle()">Toggle</button>
<p onclick="cycle()">Press Toggle to pause randomization</p>

<a id="myURL" target='_blank'>
<img id="myImg">

  const cursor = document.querySelector('.cursor'); // to select the class, cursor rather
  document.addEventListener('mousemove', e => { // when mouse moves, returns information to mouse event
    cursor.setAttribute("style", "top: "+e.pageY+"px; left: "+e.pageX+"px;") //everytime mouse moves, adjust style attribute

<style type="text/css">

	body,td,th {
		color: #000;
		font-family: Helvetica, sans-serif;


                .cursor {
  width: 20px;
  height: 20px;
  border: 1px solid red;
  border-radius: 50%;
  position: absolute;