CSS Concept: position: pointer;
How do I make an css concept: position: pointer;?
A new CSS position property type concept that sets an element position according to the pointer position. This position type is similar to the 'absolute' type but instead of being preset, its 'top','left' values are dynamically changing according to pointer movements (touch positions on touch-interfaces) in all directions or only horizontal or vertical directions.. What is a css concept: position: pointer;? How do you make a css concept: position: pointer;? This script and codes were developed by Yogev Ahuvia on 11 September 2022, Sunday.
CSS Concept: position: pointer; - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS Concept: position: pointer;</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ button { font-family: monospace; font-size: 20px; display: block; position: pointer; top: 50%; left: 50%; outline: none; width: 280px; height: 280px; margin: -140px -140px; border: 0; border-radius: 100%; opacity: 0.85; background-color: #f977a3; *zoom: 1; filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFF977A3', endColorstr='#FFD9666F'); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y5NzdhMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5NjY2ZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f977a3), color-stop(100%, #d9666f)); background-image: -moz-linear-gradient(top, #f977a3 0%, #d9666f 100%); background-image: -webkit-linear-gradient(top, #f977a3 0%, #d9666f 100%); background-image: linear-gradient(to bottom, #f977a3 0%, #d9666f 100%); -moz-appearance: none; -webkit-appearance: none; box-shadow: inset 0px 1px 1px white, 0px 1px 2px rgba(0, 0, 0, 0.3);
}
button > label, button > span { cursor: inherit;
}
button > span { font-size: 13px;
}
button:hover { background-color: #f7afc7; *zoom: 1; filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFF7AFC7', endColorstr='#FFD9666F'); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y3YWZjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5NjY2ZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f7afc7), color-stop(100%, #d9666f)); background-image: -moz-linear-gradient(top, #f7afc7 0%, #d9666f 100%); background-image: -webkit-linear-gradient(top, #f7afc7 0%, #d9666f 100%); background-image: linear-gradient(to bottom, #f7afc7 0%, #d9666f 100%);
}
button:active { box-shadow: 0px 1px 1px white, inset 0px 1px 2px rgba(0, 0, 0, 0.3); background-color: #d9666f; *zoom: 1; filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFD9666F', endColorstr='#FFF7AFC7'); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Q5NjY2ZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Y3YWZjNyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d9666f), color-stop(100%, #f7afc7)); background-image: -moz-linear-gradient(top, #d9666f 0%, #f7afc7 100%); background-image: -webkit-linear-gradient(top, #d9666f 0%, #f7afc7 100%); background-image: linear-gradient(to bottom, #d9666f 0%, #f7afc7 100%);
}
mark { background: none; font-weight: bold; text-decoration: underline;
}
body { background: #222; position: absolute; width: 100%; height: 100%;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <button data-position="pointer"> <label>position: pointer;</label><br /> <span> <mark>p</mark>ointer pointer-<mark>x</mark>, pointer-<mark>y</mark> Click to switch states </span>
</button>
<!--
Author: Yogev Ahuvia © All Rights Reserved
##########################################
A new CSS position property type concept that sets an element
position according to the pointer position while hovering.
On touch-based interface, the pointer position could be the
point(s) of touch.
The new position type supports 3 values:
'pointer': the element will follow pointer
'pointer-x': the element will follow the pointer horizontaly
'pointer-y': the element will follow the pointer verticaly
--> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
CSS Concept: position: pointer; - Script Codes CSS Codes
button { font-family: monospace; font-size: 20px; display: block; position: pointer; top: 50%; left: 50%; outline: none; width: 280px; height: 280px; margin: -140px -140px; border: 0; border-radius: 100%; opacity: 0.85; background-color: #f977a3; *zoom: 1; filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFF977A3', endColorstr='#FFD9666F'); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y5NzdhMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5NjY2ZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f977a3), color-stop(100%, #d9666f)); background-image: -moz-linear-gradient(top, #f977a3 0%, #d9666f 100%); background-image: -webkit-linear-gradient(top, #f977a3 0%, #d9666f 100%); background-image: linear-gradient(to bottom, #f977a3 0%, #d9666f 100%); -moz-appearance: none; -webkit-appearance: none; box-shadow: inset 0px 1px 1px white, 0px 1px 2px rgba(0, 0, 0, 0.3);
}
button > label, button > span { cursor: inherit;
}
button > span { font-size: 13px;
}
button:hover { background-color: #f7afc7; *zoom: 1; filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFF7AFC7', endColorstr='#FFD9666F'); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y3YWZjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5NjY2ZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f7afc7), color-stop(100%, #d9666f)); background-image: -moz-linear-gradient(top, #f7afc7 0%, #d9666f 100%); background-image: -webkit-linear-gradient(top, #f7afc7 0%, #d9666f 100%); background-image: linear-gradient(to bottom, #f7afc7 0%, #d9666f 100%);
}
button:active { box-shadow: 0px 1px 1px white, inset 0px 1px 2px rgba(0, 0, 0, 0.3); background-color: #d9666f; *zoom: 1; filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFD9666F', endColorstr='#FFF7AFC7'); background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Q5NjY2ZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Y3YWZjNyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d9666f), color-stop(100%, #f7afc7)); background-image: -moz-linear-gradient(top, #d9666f 0%, #f7afc7 100%); background-image: -webkit-linear-gradient(top, #d9666f 0%, #f7afc7 100%); background-image: linear-gradient(to bottom, #d9666f 0%, #f7afc7 100%);
}
mark { background: none; font-weight: bold; text-decoration: underline;
}
body { background: #222; position: absolute; width: 100%; height: 100%;
}
CSS Concept: position: pointer; - Script Codes JS Codes
$(document).on('mousemove', function(e) { $('[data-position="pointer"]').css('top', e.pageY).css('left', e.pageX); $('[data-position="pointer-x"]').css('left', e.pageX); $('[data-position="pointer-y"]').css('top', e.pageY);
});
$('[data-position^=pointer]').css('position', 'absolute');
$(document).on('mouseenter', function() { $(window).focus();
});
$(document).on('mouseleave', function() { $(window).blur(); $('.item').css({'top':'50%', 'left':'50%'});
});
function switchPositionType($element, type) { $element.attr('data-position', type); $('button > label').text('position: '+type+';');
}
$('button').on('click', function() { $('[data-position^=pointer]').each(function(index, element) { if ($(this).attr('data-position') == 'pointer') switchPositionType($(this), 'pointer-x'); else if ($(this).attr('data-position') == 'pointer-x') switchPositionType($(this), 'pointer-y'); else if ($(this).attr('data-position') == 'pointer-y') switchPositionType($(this), 'pointer'); });
});
$(window).on('keydown', function(e) { switch (e.keyCode) { case 80: // 'p' switchPositionType($('button'), 'pointer'); break; case 88: // 'x' switchPositionType($('button'), 'pointer-x'); break; case 89: // 'y' switchPositionType($('button'), 'pointer-y'); break; }
});
Developer | Yogev Ahuvia |
Username | kindofone |
Uploaded | September 11, 2022 |
Rating | 3.5 |
Size | 5,246 Kb |
Views | 34,408 |
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!
Name | Size |
Natural Language Accordion Form | 8,426 Kb |
Living Interfaces - Talk | 7,280 Kb |
Thumbnail Animation Effects | 10,393 Kb |
Subtle Buttons | 4,010 Kb |
CSS Filter Glass | 7,188 Kb |
Spinning Top | 6,037 Kb |
Reactive CSS Transitions | 4,405 Kb |
Live Bricks | 7,014 Kb |
A Pen by Yogev Ahuvia | 1,941 Kb |
Bouncy Icon Select Menu | 6,673 Kb |
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!
Name | Username | Size |
Pure CSS Animated Photo Stack | Depthdev | 2,486 Kb |
Mobile Sub Menu Concept | Berdejitendra | 2,790 Kb |
Haml Calendar | Katydecorah | 5,643 Kb |
BlueBox Fork | Huskynation | 12,675 Kb |
Playing with FlexBox | _Billy_Brown | 3,162 Kb |
CSS3 Animated buttons | Cguillou | 3,737 Kb |
Scifi-style Radio-based Tab | Aaronchuo | 4,427 Kb |
Next Word Predictor | Rfalor | 2,776 Kb |
CSS Org Chart | Appirio-ux | 3,882 Kb |
RPG Style Text Dialogue | Odylic | 2,635 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!