demo20230512/Areas/Certification/Content/js/detail.js
2023-05-12 10:20:28 +08:00

95 lines
3.3 KiB
JavaScript

(function ($) {
$(function () {
// start of fancybox
$('.iframe').fancybox({
maxWidth: 800,
maxHeight: 600,
minHeight: 400,
fitToView: false,
width: '70%',
height: '50%',
autoSize: false,
closeClick: false,
openEffect: 'none',
closeEffect: 'none',
beforeShow: function () {
$(".fancybox-skin").css("backgroundColor", "#fff");
}
});
$('#product-pictue').fancybox({
helpers: {
title: {
tyle: 'float'
}
}
});
// end of fancybox
// start of scroll spy animation
$('.scroller').click(function (event) {
var activeDestination = $(this).attr("href");
var scrollDistance = 0;
var activeLi = $('#docs-scroll-hash-nav').find('li.active a')[0];
var scrollTop = $($(activeLi).attr('href')).offset().top;
scrollDistance = Math.abs($(activeDestination).offset().top - 30 - scrollTop);
var scrollTime = 400 + scrollDistance / 2 >= 1000 ? 1000 : 400 + scrollDistance / 2;
$('html, body').animate({
scrollTop: $(activeDestination).offset().top - 30
}, scrollTime);
event.preventDefault();
});
// end of scroll spy animation
// start of sticky effect
var contentHeight = $($('#docs-scroll-hash-content')[0]).height();
$($('.side-bar')).height(contentHeight);
$($('.is-sticky')).height(contentHeight);
$($('#docs-scroll-hash-nav')).height(contentHeight);
// end of sticky effect
// start of confirm window
$('#confirm-button').click(function () {
if (confirm("你確定要確認該次盤查嗎?")) {
$('#lca-confirm').submit();
}
});
$('#reject-button').click(function () {
if (confirm("你確定要駁回該次盤查嗎?")) {
$('#lca-reject').submit();
}
});
$('#confirm-button2').click(function () {
if (confirm("你確定要確認該次盤查嗎?")) {
$('#lca-confirm2').submit();
}
});
$('#reject-button2').click(function () {
if (confirm("你確定要駁回該次盤查嗎?")) {
$('#lca-reject2').submit();
}
});
$('#refuse-button').click(function () {
if (confirm("你確定要拒絕查證該盤查案嗎?")) {
$('#lca-refuse').submit();
}
});
$('#refuse-button2').click(function () {
if (confirm("你確定要拒絕查證該盤查案嗎?")) {
$('#lca-refuse2').submit();
}
});
$('#ProductLca_ScheduledVerificationDate').change(function () {
$('#lca-ChangeScheduledVerificationDate').submit();
})
$('#ScheduledVerificationDate').change(function () {
$('#lca-ChangeScheduledVerificationDate').submit();
})
// end
$($('#empty')).height($(window).height() - $('table').last().height() - 160);
});
})($);