Buttons.js - Example

Developer
Size
3,730 Kb
Views
8,096

How do I make an buttons.js - example?

How to usage for this snippet - http://codepen.io/dipscom/pen/RPmrzo. What is a buttons.js - example? How do you make a buttons.js - example? This script and codes were developed by Pedro Tavares on 01 December 2022, Thursday.

Buttons.js - Example Previews

Buttons.js - Example - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Buttons.js - Example</title> <link rel='stylesheet prefetch' href='css/rwxpbb.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id='reporter' class='box left'><h3>I am going to tell you which box you have clicked</h3></div>
<div id='reporter-over' class='box left'><h3>I am going to tell you which element you are hovering over</h3></div>
<div id='reporter-out' class='box left'><h3>I am going to tell you which element you have hovering out of</h3></div>
<div id='box1' class='box'> <p>I am some text without an id sitting in a div with its default styles</p>
</div>
<div id='box2' class='box'> <p id="text">I am some text with an id sitting in a div with its default styles</p>
</div>
<div id='box3' class='box'>
<p id="text1"> I am some clickable text</div>
<div id='box4' class='absolute box'> <p> I am some text without an id in a absolutely positioned div</p>
</div>
<div id='box5' class='box'> <p>I am a box with an id, some text and an image with id and class.</p> <img id='tomato' class='image' src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/259155/tomatoSlice.png" alt="A tomato slice" />
</div> <script src='js/rpmrzo.js'></script> <script src="js/index.js"></script>
</body>
</html>

Buttons.js - Example - Script Codes CSS Codes

/* **************************************** */
/* Default CSS styles being imported from:
/* https://codepen.io/dipscom/pen/RWXPBB
/* **************************************** */
/* ****************** */
/* Notes and reminders
/* ****************** */
/* ****************** */
/* Local CSS styling
/* ****************** */
h3 { display: inline;
}
.box { padding: 8px; margin: 8px; width: initial;
}
.absolute { position: absolute; bottom: 10px; right: 10px; max-width: 200px;
}
.left { display: block;
}
#text1 { background: rgba(0,0,0,0.05);
}

Buttons.js - Example - Script Codes JS Codes

// TO DO: find a way to stop the event at the topmost element and return its id or class
var btn = new Buttons(true);
btn.enable(["box1", "box2", "box3", "box4", "box5", "text1"]);
window.addEventListener("CLICKED", clicked);
window.addEventListener("MOUSE_OVER", hoverover);
window.addEventListener("MOUSE_OUT", hoverout);
function clicked(e) { var target = document.getElementById('reporter'); target.innerHTML = "<h3>Clicked on</h3> " + e.param;
}
function hoverover(e) { var target = document.getElementById('reporter-over'); target.innerHTML = "<h3>Hoverred over</h3> " + e.param;
}
function hoverout(e) { var target = document.getElementById('reporter-out'); target.innerHTML = "<h3>Hovered out of:</h3> " + e.param;
}
Buttons.js - Example - Script Codes
Buttons.js - Example - Script Codes
Home Page Home
Developer Pedro Tavares
Username dipscom
Uploaded December 01, 2022
Rating 3
Size 3,730 Kb
Views 8,096
Do you need developer help for Buttons.js - Example?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Pedro Tavares (dipscom) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!