ดูหนังออนไลน์
หนังใหม่ 2026
หนังชนโรง
หนังการ์ตูน
หนังไทย
ดูซีรี่ย์
NETFLIX
TOP IMDB
ดูหนังออนไลน์
หนังใหม่ 2026
หนังชนโรง
หนังการ์ตูน
หนังไทย
ดูซีรี่ย์
NETFLIX
TOP IMDB
ดูหนังออนไลน์
หนังใหม่ 2026
หนังชนโรง
หนังการ์ตูน
หนังไทย
ดูซีรี่ย์
NETFLIX
TOP IMDB
(function () {
const searchWrap = document.querySelector('.header .container-logo .search');
const form = searchWrap ? searchWrap.querySelector('.searchform') : null;
const input = form ? form.querySelector('input[name="keyword"]') : null;
const resultsBox = searchWrap ? searchWrap.querySelector('.header-search-autocomplete') : null;
const siteURL = 'https://www.24-hds.com';
const endpoint = 'https://stat.24-hds.com/search_autocomplete';
let timer;
let controller;
if (!input || !resultsBox) {
return;
}
input.setAttribute('autocomplete', 'off');
function stripHTML(html) {
const doc = new DOMParser().parseFromString(html || '', 'text/html');
return doc.body.textContent || '';
}
function escapeHTML(value) {
const div = document.createElement('div');
div.textContent = value || '';
return div.innerHTML;
}
function buildURL(path) {
if (!path) {
return siteURL;
}
if (/^https?:\/\//i.test(path)) {
return path;
}
return siteURL + path;
}
function renderResults(results) {
resultsBox.innerHTML = '';
if (!Array.isArray(results) || results.length === 0) {
resultsBox.innerHTML = '<div class="header-search-empty">ไม่พบหนังที่ค้นหา</div>';
resultsBox.classList.add('is-open');
return;
}
results.forEach(function (movie) {
const item = document.createElement('a');
item.className = 'header-search-item';
item.href = buildURL(movie.url_path);
item.target = '_blank';
item.rel = 'noopener noreferrer';
item.innerHTML =
'<img src="' + escapeHTML(buildURL(movie.image_url)) + '" alt="" class="header-search-poster" loading="lazy" onerror="this.style.visibility="hidden"">' +
'<div class="header-search-info">' +
'<div class="header-search-title">' + escapeHTML(movie.post_title) + '</div>' +
'<p class="header-search-brief">' + escapeHTML(stripHTML(movie.plot_TH)) + '</p>' +
'</div>';
resultsBox.appendChild(item);
});
resultsBox.classList.add('is-open');
}
input.addEventListener('input', function () {
const query = input.value.trim();
clearTimeout(timer);
if (controller) {
controller.abort();
}
if (query.length < 3) {
resultsBox.innerHTML = '';
resultsBox.classList.remove('is-open');
return;
}
resultsBox.innerHTML = '<div class="header-search-status">กำลังค้นหา...</div>';
resultsBox.classList.add('is-open');
timer = setTimeout(function () {
controller = new AbortController();
fetch(endpoint + '?site_id=1&SearchString=' + encodeURIComponent(query), {
signal: controller.signal,
headers: { 'Accept': 'application/json' }
})
.then(function (response) {
if (!response.ok) {
throw new Error('Search request failed');
}
return response.json();
})
.then(renderResults)
.catch(function (error) {
if (error.name === 'AbortError') {
return;
}
resultsBox.innerHTML = '<div class="header-search-empty">ค้นหาไม่ได้ชั่วคราว</div>';
resultsBox.classList.add('is-open');
});
}, 400);
});
input.addEventListener('focus', function () {
if (resultsBox.innerHTML.trim() !== '') {
resultsBox.classList.add('is-open');
}
});
document.addEventListener('click', function (event) {
if (event.target.closest('.header .container-logo .search')) {
return;
}
resultsBox.classList.remove('is-open');
});
})();
function halim_Player(episode, server, postid, ep_link, lang){
jQuery.ajax({
url: '/get.php',
type: 'POST',
data: {
action : 'halim_ajax_player',
nonce : ajax_player.nonce,
episode : episode,
server : server,
postid : postid,
lang : ""+lang+"",
title : halim_cfg.post_title
},
success: function(data)
{
var data = data.replace(/\\/g, "");
if(data) {
jQuery("#ajax-player").html(data);
}
}
});
}
jQuery(document).ready(function($)
{
if(typeof halim_cfg != 'undefined' || typeof playerInstance != 'undefined') {
var lang = null;//Cookies.get('lang');
if (typeof lang === 'undefined' || lang == null){
halim_cfg.lang = $("#Lang_select").val($("#Lang_select option:first").val());
} else {
halim_cfg.lang = lang;
}
if ($("#Lang_select option[value='"+halim_cfg.lang+"']").length > 0) {
$("#Lang_select").val(halim_cfg.lang);
} else {
$("#Lang_select").val($("#Lang_select option:first").val());
halim_cfg.lang = $("#Lang_select option:first").val();
}
if($('#ajax-player').length !== 0) {
halim_Player(halim_cfg.episode, halim_cfg.server, halim_cfg.post_id, '',halim_cfg.lang);
setTimeout(function(){
var embed = $(document).find('.halim-btn.active').data('embed');
var type = $(document).find('.halim-btn.active, .halim-episode .active').data('type');
if(embed == 1 || type == 'facebook'){
$("#autonext").hide();
}else{
$("#autonext").show();
}
}, 500);
}
}
// Define parameters
var webId = 1;
var imdbId = '';
$.ajax({
url: 'https://stat.24-hds.com/video_counter',
type: 'GET',
data: {
web_id: webId,
imdb_id: imdbId
},
dataType: 'json',
success: function(response) {
if (response.success) {
console.log('View count successfully recorded:', response.message);
} else {
console.warn('Warning from server:', response.message);
}
},
error: function(xhr, status, error) {
console.error('Failed to connect to video counter server:', error);
}
});
$('body').on('click', '.halim-btn', function()
{
var post_id = $(this).data('post-id');
var server = $(this).data('server');
var episode = $(this).data('episode');
var eps_title = $(this).data('title');
var embed = $(this).data('embed');
var lang = halim_cfg.lang;
halim_cfg.post_title = $(this).data('title');
halim_cfg.server = server;
$('.halim-btn').removeClass('active');
$(this).addClass('active');
if (!post_id) return;
halim_Player(halim_cfg.episode, server, post_id, '',lang);
// $('[data-toggle="resume"]').popover('hide');
if(typeof playerInstance != 'undefined') playerInstance.pause();
//$('#ajax-player').html('<p style="margin-top: 40%;">กำลังโหลดโปรดรอ...</p>');
//$('html, body').animate({scrollTop: $('#ajax-player').offset().top -10 }, 2000);
if(embed == 1){
$("#autonext").hide();
} else {
$("#autonext").show();
}
if(history.pushState) {
var slug = (halim_cfg.type_slug == 'slug-1') ? halim_cfg.server_slug+'-'+server : halim_cfg.server_slug+server;
}
});
$('body').on('click', '.get-eps', function()
{
alert('eps');
var episode = $('.halim-btn.active').data('episode');
var server = $('.halim-btn.active').data('server');
var postid = $('.halim-btn.active').data('post-id');
var lang = $('.halim-btn.active').data('lang');
var ep_link = $(this).data('url');
if(typeof playerInstance != 'undefined') playerInstance.pause();
$(this).addClass('active').siblings().removeClass('active');
halim_Player(episode, server, postid, ep_link,'',lang);
$('#ajax-player').html('<p style="margin-top: 40%;">กำลังโหลดโปรดรอ...</p>');
});
$("#autonext").on('click', function()
{
if($("#autonext-status").text() == 'On'){
$("#autonext-status").text('Off');
}
else {
$("#autonext-status").text('On');
}
});
});
function loadAPI() {
var js = document.createElement('script');
js.src = 'https://connect.facebook.net/th_TH/sdk.js#xfbml=1&version=v14.0&appId=1574096012810602&autoLogAppEvents=1';
document.body.appendChild(js);
}
window.onscroll = function () {
var rect = document.getElementById('comments').getBoundingClientRect();
if (rect.top < window.innerHeight) {
//loadAPI();
window.onscroll = null;
}
}
iframe {
width: 100%
}
.content-col .content-coll {
display: -ms-grid;
display: grid;
-ms-grid-columns: 34% 65%;
grid-template-columns: 34% 65%;
grid-gap: 1%;
padding-bottom: 21px;
}
.content-col .content-coll2 {
display: -ms-grid;
display: grid;
-ms-grid-columns: 34% 65%;
grid-template-columns: 20% 60% 20%;
grid-gap: 1%;
padding-bottom: 21px;
}
.lang {
color: #fff;
background-color: #209b56;
border-radius: 5px 5px 5px 5px;
padding: 7px 0;
text-align: center;
font-size: 16px;
}
#halim-list-server_n .halim-server-name {
background: #365979;
padding: 6px 10px;
margin: -1.6px 6px 0 0;
font-size: 12px;
color: #fff;
border-radius: 3px;
display: inline-block;
line-height: 16px;
float: left
}
#halim-list-server_n ul {
padding: 0;
list-style: none
}
#halim-list-server_n li {
display: inline-block;
margin: 0 3px 10px 0
}
#halim-list-server_n ul li span {
background-image: linear-gradient(to bottom,#ee0979,#ff6a00);
padding: 7.5px 20px 6px;
border-radius: 3px;
transition: .6s all;
font-size: 24px;
color: #fff;
cursor: pointer;
}
#halim-list-server_n li:hover span {
background: #FF0000
}
#halim-list-server_n ul li span.active {
background: #e46565
}
#halim-list-server_n ul li:hover span.active {
background: #315c84
}
#halim-list-server_n ul.nav-tabs li {
margin: 0
}
#halim-list-server_n ul.nav-tabs li a {
margin: 0;
border: none;
padding: 7px 12px;
border-radius: 0;
font-size: 12px
}
#halim-list-server_n ul.nav-tabs li a:hover {
margin: 0!important
}
#halim-list-server_n ul.nav-tabs li.active {
background: #263a4c
}
#halim-list-server_n ul.nav-tabs li.active a {
margin: 0;
border: none;
padding: 7px 12px
}
#halim-list-server_n .tab-content ul {
margin: 0;
padding: 15px 0
}
#halim-list-server_n .tab-content {
background: #0b0f15;
padding: 0 15px
}
.halim-light-mode #halim-list-server_n .tab-content {
background: #e9ebee;
padding: 0 15px
}
.halim-light-mode #halim-list-server_n ul li span {
background-color: #fff;
color: #333;
border: 1px solid #cacaca;
padding: 7.5px 10px 6px;
text-shadow: none;
box-shadow: none
}
.halim-light-mode #halim-list-server_n li:hover span {
background: #FF0000;
color: #fff;
border-color: #f90
}
.halim-light-mode #halim-list-server_n ul li span.active {
background: #e46565;
border-color: #e46565;
color: #fff
}
#halim-list-server_n .halim-server.show_all_eps .halim-server-name {
float: none!important;
margin-bottom: -5px!important;
background: #0b0f15;
padding: 8px 14px 5px;
color: #ea9b06;
font-weight: bold;
text-transform: uppercase
}
.start-video {
position: absolute;
top: 38%;
padding: 9px;
left: 40%;
opacity: .3;
cursor: pointer;
transition: all 0.3s;
}
.start-video:hover
{
opacity: 1;
-webkit-filter: brightness (1);
}
div.thumbnail_container
{
height: 315px;
overflow: hidden;
background-color: #000;
}
img.thumbnail
{
height: 375px;
margin-top: -50px;
opacity: 0.5;
}