You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
167 lines
4.3 KiB
167 lines
4.3 KiB
jQuery(document).ready(function($){
|
|
currentSlide = 0;
|
|
|
|
$(".more").css("cursor","pointer");
|
|
$(".less").css("cursor","pointer");
|
|
$(".ext-content").css("display","none");
|
|
|
|
$(".item-more").click(function(){
|
|
window.location.href = "ecourse.html";
|
|
});
|
|
|
|
$(".more").click(function(){
|
|
$(".less").trigger("click");
|
|
$(this).slideUp().parent().next().slideDown();
|
|
$(window).resize();
|
|
});
|
|
|
|
|
|
$(".less").click(function(){
|
|
$(this).parent().parent().slideUp().prev().children().slideDown();
|
|
});
|
|
|
|
$(".ebooks-video-instance").click(function(){
|
|
$(".overlay").show();
|
|
$(".overlay").append("<video id='customvediotag' width='100%' height='100%' controls='controls' autoplay='autoplay' ><source src='video/op2_demo.mp4' type='video/mp4'>Your browser does not support the video tag.</video>");
|
|
checkVideoDimention()
|
|
});
|
|
|
|
$('.cross').on('click', function() {
|
|
closeVideo();
|
|
});
|
|
|
|
$(window).scroll(function() {
|
|
if ($(this).scrollTop() > 100) {
|
|
$('.back-to-top').fadeIn();
|
|
} else {
|
|
$('.back-to-top').fadeOut();
|
|
}
|
|
});
|
|
$('.back-to-top').click(function() {
|
|
$("html, body").animate({scrollTop: 0}, 600);
|
|
return false;
|
|
});
|
|
|
|
$("#nav-english").click(function() {
|
|
var target = $("#English-toeic");
|
|
$('html, body').animate({
|
|
scrollTop: target.offset().top
|
|
}, 1000);
|
|
target.find(".more").trigger("click");
|
|
});
|
|
|
|
$("#nav-lms").click(function() {
|
|
var target = $("#LMS");
|
|
$('html, body').animate({
|
|
scrollTop: target.offset().top
|
|
}, 1000);
|
|
target.find(".more").trigger("click");
|
|
});
|
|
|
|
$("#nav-test").click(function() {
|
|
var target = $("#Test");
|
|
$('html, body').animate({
|
|
scrollTop: target.offset().top
|
|
}, 1000);
|
|
target.find(".more").trigger("click");
|
|
});
|
|
|
|
$("#nav-ebook").click(function() {
|
|
var target = $("#Ebook");
|
|
$('html, body').animate({
|
|
scrollTop: target.offset().top
|
|
}, 1000);
|
|
target.find(".more").trigger("click");
|
|
});
|
|
|
|
$('.cb-slideshow').Slideshow();
|
|
|
|
$(".cb-slideshow").each(function(){
|
|
i = 0;
|
|
|
|
slideTime = 15;
|
|
slideCount = $(this).children(".sl-item").length;
|
|
totalSlideTime = slideTime * slideCount;
|
|
/*
|
|
$(this).children(".sl-item").each(function(){
|
|
time = i*slideTime;
|
|
$(this).children("img").css("animation","slideshowImg "+totalSlideTime+"s infinite");
|
|
$(this).children("img").css("animation-delay",""+time+"s");
|
|
|
|
$(this).children(".e-course-content").css("animation","slideshowItemTitle "+totalSlideTime+"s infinite");
|
|
$(this).children(".e-course-content").css("animation-delay",""+time+"s");
|
|
|
|
i++;
|
|
});
|
|
*/
|
|
});
|
|
|
|
/*
|
|
$(".design-process-step").click(function(){
|
|
var $this = $(this);
|
|
var offset = $this.offset();
|
|
var width = $this.width();
|
|
var height = $this.height();
|
|
|
|
var centerX = offset.left + width / 2;
|
|
var centerY = offset.top + height / 2;
|
|
|
|
var $detail = $this.children(".design-process-step-detail");
|
|
|
|
$(".design-process-step .design-process-step-detail").hide();
|
|
|
|
$detail.show();
|
|
$detail.css("left",($this.innerWidth() - $detail.innerWidth())/2 - 4);
|
|
$detail.css("top",($this.innerWidth() - $detail.innerWidth())/2 - 4);
|
|
});
|
|
*/
|
|
|
|
$(".design-process-step").each(function(){
|
|
var $this = $(this);
|
|
|
|
var $detail = $this.children(".design-process-step-detail");
|
|
|
|
$detail.css("left",($this.innerWidth() - $detail.innerWidth())/2 - 4);
|
|
$detail.css("top",($this.innerWidth() - $detail.innerWidth())/2 - 4);
|
|
});
|
|
|
|
$('.process-detail').Slide();
|
|
|
|
|
|
$(window).resize(function(){
|
|
$('.v-center-item').each(function(){
|
|
$(this).css({height:$(this).parent().height()});
|
|
});
|
|
|
|
checkVideoDimention();
|
|
});
|
|
|
|
// To initially run the function:
|
|
$(window).resize();
|
|
|
|
});
|
|
|
|
function closeVideo() {
|
|
$('.overlay').css('display', 'none');
|
|
$("#customvediotag").remove();
|
|
}
|
|
|
|
function checkVideoDimention() {
|
|
var windowInnerHeight = window.innerHeight,
|
|
windowInnerWidth = window.innerWidth,
|
|
videoHeight = $("#customvediotag").height(),
|
|
videoWidth = $("#customvediotag").width();
|
|
|
|
if ((windowInnerWidth - 15) > 1280 && $("#customvediotag") !== []) {
|
|
$("#customvediotag").width(1280);
|
|
} else {
|
|
$("#customvediotag").width("100%");
|
|
}
|
|
if ((windowInnerHeight > 720) && $("#customvediotag") !== []) {
|
|
$("#customvediotag").height(720);
|
|
console.log("height added");
|
|
} else {
|
|
$("#customvediotag").height("100%");
|
|
|
|
}
|
|
}
|
|
|