Skip to content

Instantly share code, notes, and snippets.

View quisido's full-sized avatar
🌸
trying my best

quisi.do quisido

🌸
trying my best
View GitHub Profile
@quisido
quisido / htmlspecialchars.js
Created August 3, 2018 17:30
PHP's htmlspecialchars implemented in JavaScript
// Create the function.
var htmlspecialchars = function(string) {
// Our finalized string will start out as a copy of the initial string.
var escapedString = string;
// For each of the special characters,
var len = htmlspecialchars.specialchars.length;
for (var x = 0; x < len; x++) {
@quisido
quisido / htmlspecialchars_decode.js
Created August 3, 2018 17:33
PHP's htmlspecialchars implemented in JavaScript
// Create the function.
var htmlspecialchars_decode = function(string) {
// Our finalized string will start out as a copy of the initial string.
var unescapedString = string;
// For each of the special characters,
var len = htmlspecialchars_decode.specialchars.length;
for (var x = 0; x < len; x++) {
@quisido
quisido / ampersands.js
Created August 3, 2018 17:39
PHP's htmlspecialchars implemented in JavaScript
/********************************\
|* Translating ampersand first: *|
\********************************/
var string = '<'; // <
string = string.replace(/&/g, '&amp;'); // <
string = string.replace(/</g, "&lt;"); // &lt;
/*******************************\
|* Translating ampersand last: *|
@quisido
quisido / html.html
Created August 5, 2018 16:30
How to Make a Graphical News Slider in jQuery
<div class="news-slider" id="news-slider-#">
<div class="padding">
<div class="background2"></div>
<div class="background"></div>
<div class="navigation bar"></div>
<div class="navigation icons">
<img alt="..." class="image#" src="..." title="" />
<img alt="..." class="image#" src="..." title="" />
<img alt="..." class="image#" src="..." title="" />
</div>
@quisido
quisido / news-slider.css
Created August 5, 2018 16:42
How to Make a Graphical News Slider in jQuery
div.news-slider {
background-color: #F8D8D0;
border: 1px outset #E0D0C0;
height: 320px;
margin: 0 auto;
text-align: left;
width: 620px;
}
div.news-slider div.padding {
@quisido
quisido / backgrounds.css
Created August 5, 2018 16:44
How to Make a Graphical News Slider in jQuery
div.news-slider div.background,
div.news-slider div.background2 {
background-repeat: no-repeat;
height: 300px;
margin-bottom: -300px;
width: 600px;
}
@quisido
quisido / navigation.css
Created August 5, 2018 16:47
How to Make a Graphical News Slider in jQuery
div.news-slider div.navigation {
height: 300px;
position: relative;
margin-bottom: -300px;
text-align: center;
width: 142px;
}
@quisido
quisido / navigation-bar-background.css
Created August 5, 2018 16:49
How to Make a Graphical News Slider in jQuery
div.news-slider div.navigation.bar {
background-color: #E0D0C0;
}
@quisido
quisido / navigation-images.css
Created August 5, 2018 16:50
How to Make a Graphical News Slider in jQuery
div.news-slider div.navigation img {
border: 2px solid #000000;
cursor: pointer;
height: 59px;
margin-top: 10px;
width: 118px;
}
div.news-slider div.navigation img:hover {
border-color: #808080;
@quisido
quisido / text.css
Created August 5, 2018 16:54
How to Make a Graphical News Slider in jQuery
div.news-slider div.text {
display: none;
float: left;
position: relative;
}
div.news-slider div.text div {
background-color: #404040;
border: 1px solid #000000;
color: #E0D0C0;