====== HTML CSS Javascript ======
{{tag>software_development html css javascript jquery}}
[[https://www.w3schools.com/|https://www.w3schools.com/]]
==== 계정 ====
https://www.hostmeca.com/
https://domain.ksidc.net/
==== Location ====
location.hash ="#n"
$(location).attr('hash')
==== List, Dictionary ====
prod = { "key":"value" };
for (var key in prod) {
key
prod[key]
}
==== CSS Style ====
$('#mask').removeClass('active');
$('#mark').addClass('active')
$('html').css('overflow', 'initial');
$(this).attr('id')
@media (min-width: 768px) {
/* wide mode css */
.classname {
attr : value !important; /* override */
}
}
==== String ====
function comma(str) { // 숫자에 컴마 및 원 붙이기
str = String(str);
return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,') + "원";
}
==== resize ====
$(window).on('resize', function() {
if ($(window).width() >= 768) {
set_tablet_mode();
status = "t";
} else {
status = "m";
}
});
==== disable Telephone Link on Desktop ====
[[https://jsfiddle.net/az96o8Ly/|https://jsfiddle.net/az96o8Ly/]]
// Use event delegation, to catch clicks on links that may be added by javascript at any time.
jQuery(document.documentElement).on('click', '[href^="tel:"]', function(e){
try{
// These user-agents probably support making calls natively.
if( /Android|webOS|iPhone|iPad|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
// Do nothing; This device probably supports making phone calls natively...
} else {
// Extract the phone number.
var phoneNumber = jQuery(this).attr('href').replace('tel:', '').trim();
// Tell the user to call it.
alert("Please call "+phoneNumber);
// Prevent the browser popup about unknown protocol tel:
e.preventDefault();
e.stopPropagation();
}
} catch(e){
console.log("Exception when catching telephone call click!", e);
}
});
==== Image resize - area map ====
[[https://github.com/stowball/jQuery-rwdImageMaps|https://github.com/stowball/jQuery-rwdImageMaps]]
==== Page onload ====
* window.onload = onPageLoad(); function onPageLoad(ids) {}
* $(window).load(function(){ }); : 더 나중에 실행됨
==== Click to popup layer ====
[[https://www.w3schools.com/howto/howto_js_popup.asp|https://www.w3schools.com/howto/howto_js_popup.asp]]
==== Table x-y scroll ====
''