123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460 |
- // var random = Math.floor(Math.random() * $('.youtube').length);
- // $('.youtube').hide().eq(random).show();
- // $(".youtube7-10").hide();
- // (function () {
- // const second = 1000,
- // minute = second * 60,
- // hour = minute * 60,
-
- // }());
- // var today =new Date();
- // console.log(today);
- // var day3 = new Date();
- // day3.setTime(day3.getTime()+24*60*60*1000);
- // console.log(day3);
- // $(".youtube7-10").hide();
- // if (today = day3) {
- // $(".youtube7-10").show();
- // }
- // sec03排名table輪播
- $('#sec03-slider').slick({
- arrows: false,
- slidesToShow: 1,
- slidesToScroll: 1,
- infinite: true,
- });
- $('#sec03-slider-next').click(function () {
- $('#sec03-slider').slick('slickNext')
- });
- // sec05 熱門作品 手機輪播
- $('#sec05-moblie-slider').slick({
- arrows: false,
- slidesToShow: 1,
- slidesToScroll: 1,
- infinite: true,
- });
- $('#sec05-slider-next').click(function () {
- $('#sec05-moblie-slider').slick('slickNext')
- });
- // sec05桌機輪播
- $('#sec05-destop-slider').slick({
- arrows: true,
- slidesToShow: 3,
- slidesToScroll: 3,
- infinite: true,
- });
- // sec06桌機輪波
- // $('#sec06-container').slick({
- // arrows: true,
- // slidesToShow: 4,
- // slidesToScroll: 3,
- // infinite:true,
- // });
- // $('#sec06-2-slider').slick({
- // arrows: true,
- // slidesToShow: 3,
- // slidesToScroll: 3,
- // infinite:true,
- // vertical:true,
- // });
- $(function () {
- $('#sec06-container').slick({
- slidesToShow: 4,
- slidesToScroll: 3,
- infinite: true,
- arrows: true,
- responsive: [
- {
- breakpoint: 600, // RWD在1024寬度時切換顯示數量
- settings: {
- arrows: false,
- slidesToShow: 1, //一次顯示3個
- slidesToScroll: 1,//切換下一頁時移動3個
- infinite: true,
- dots: false,
- }
- }, {
- breakpoint: 600,// RWD在600寬度時切換顯示數量
- settings: {
- arrows: false,
- slidesToShow: 1,//一次顯示2個
- slidesToScroll: 1,//切換下一頁時移動2個
- infinite: true,
- dots: false,
- }
- },
- ]
- });
- })
- // sec04 洞察報告 手機輪播
- $('#sec04-moblie-container').slick({
- arrows: false,
- slidesToShow: 1,
- slidesToScroll: 1,
- infinite: true,
- // centerMode: true,
- });
- // $('#sec04-slider-next').click(function () {
- // $('#sec04-moblie-container').slick('slickNext')
- // });
- // 手機板menu彈跳視窗
- $(".menu-box2").hide();
- $(".menu-box").hide();
- $(".link").click(function () {
- $("#menu-box").fadeOut("slow", function () {
- $("#menu-box2").fadeOut("slow");
- // Animation complete.
- });
- });
- $("#menu-btn1").click(function () {
- $(".menu-box").fadeIn();
- $(".menu-box2").fadeIn();
- });
- $(".close").click(function () {
- $(".menu-box").fadeOut();
- $(".menu-box2").fadeOut();
- });
- $("*").each(function (index, element) {
- // 此元素被點選後執行
- $(this).click(function (e) {
- // 取得被點選元素的屬性:data-gt-target
- var target = $(this).attr("data-gt-target");
- var duration = $(this).attr("data-gt-duration");
- var offset = $(this).attr("data-gt-offset");
- // JS 語法:判斷式
- // if (條件) {程式區塊}
- // 當條件成立,會執行程式區塊
- // 如果 目標有資料 才會執行 { } 內的程式
- // 避免出現 undefine (未定義 - 不存在的資料)
- if (target) {
- //console.log("目標:" + target);
- //console.log("時間:" + duration);
- //console.log("位移:" + offset);
- // 上方位置 = 目標區塊.位移().上方位置
- var top = $(target).offset().top;
- //console.log("要前往元素的上方位置:" + top);
- // 網頁元素.停止().動畫({ 上方捲動:指定元素 - 位移},持續時間)
- // parseInt() 將文字轉為數字
- $("html").stop().animate({
- scrollTop: top - offset
- }, parseInt(duration));
- }
- });
- });
- // 避免動畫與使用者滾輪衝突
- // html 在滾動滾輪時 停止 html 所有效果
- $("html").on("mousewheel", function () {
- $("html").stop();
- });
- $(".sec03-table-title").addClass("contant-toggle");
- $("#sec03-slider").on('beforeChange', function (event, slick, currentSlide, nextSlide) {
- console.log('beforeChangeEvent: currenSlide=' + currentSlide + ', nextSlide= ' + nextSlide);
- if (nextSlide == 1) {
- $(".sec03-table-title").removeClass("contant-toggle");
- $(".sec03-table-title2").addClass("contant-toggle");
- }
- else if (nextSlide == 0) {
- $(".sec03-table-title2").removeClass("contant-toggle");
- $(".sec03-table-title").addClass("contant-toggle");
- }
- });
- // 電腦版email
- $.fn.serializeObject = function () {
- var o = {};
- var a = this.serializeArray();
- // o["id"] = 0;
- // o["time_stamp"] = "";
- $.each(a, function () {
- if (o[this.name]) {
- if (!o[this.name].push) {
- o[this.name] = [o[this.name]];
- }
- o[this.name].push(this.value || '');
- } else {
- o[this.name] = this.value || '';
- }
- });
- return o;
- };
- $(".contact-form-destop").submit(function (e) {
- /* var formRef = $('#form1').serializeArray();
- var jsonString = JSON.stringify(formRef);*/
- var jsonInfo = $('.contact-form-destop').serializeObject();
- var jsonString = JSON.stringify(jsonInfo);
- console.log(jsonString),
- $.ajax({
- type: 'POST',
- url: 'https://nftboard.info:8001/add_sub',
- data: jsonString,
- dataType: 'json',
- success: function (data) {
- console.log('送出成功: ' + data);
- alert("訂閱成功");
- // if (data == 0) {
- // alert("送出成功");
- // } else if (data == 1) {
- // alert("此email已填過表單");
- // } else if (data == 2) {
- // alert("此phone已填過表單");
- // } else if (data == 3) {
- // alert("此email、phone已填過表單");
- // }
- location.reload();
- },
- beforeSend: function () {
- console.log('beforeSend');
- },
- complete: function () {
- console.log('complete');
- },
- error: function (jqXHR, textStatus, errorThrown) {
- console.log(JSON.stringify(jqXHR));
- console.log("AJAX errr: " + textStatus + ' : ' + errorThrown);
- console.log('送出失敗: ' + jqXHR.responseText);
- }
- });
- return false;
- });
- // 手機板 email
- $.fn.serializeObject = function () {
- var o = {};
- var a = this.serializeArray();
- $.each(a, function () {
- if (o[this.name]) {
- if (!o[this.name].push) {
- o[this.name] = [o[this.name]];
- }
- o[this.name].push(this.value || '');
- } else {
- o[this.name] = this.value || '';
- }
- });
- return o;
- };
- $(".contact-form-mobile").submit(function (e) {
- /* var formRef = $('#form1').serializeArray();
- var jsonString = JSON.stringify(formRef);*/
- var jsonInfo = $('.contact-form-mobile').serializeObject();
- var jsonString = JSON.stringify(jsonInfo);
- console.log(jsonString),
- $.ajax({
- type: 'POST',
- url: 'https://nftboard.info:8001/add_sub',
- data: jsonString,
- dataType: 'json',
- success: function (data) {
- console.log('送出成功: ' + data);
- alert("訂閱成功");
- // if (data == 0) {
- // alert("送出成功");
- // } else if (data == 1) {
- // alert("此email已填過表單");
- // } else if (data == 2) {
- // alert("此phone已填過表單");
- // } else if (data == 3) {
- // alert("此email、phone已填過表單");
- // }
- location.reload();
- },
- beforeSend: function () {
- console.log('beforeSend');
- },
- complete: function () {
- console.log('complete');
- },
- error: function (jqXHR, textStatus, errorThrown) {
- console.log(JSON.stringify(jqXHR));
- console.log("AJAX errr: " + textStatus + ' : ' + errorThrown);
- console.log('送出失敗: ' + jqXHR.responseText);
- }
- });
- return false;
- });
- $(function () {
- $("#sec05-moblie").swipe({ fingers: 'all', swipeLeft: swipe1, swipeRight: swipe2 });
- function swipe1(event, direction, distance, duration, fingerCount) {
- $('#sec05-moblie-slider').slick('slickNext')//向左滑動你要執行的動作
- }
- function swipe2(event, direction, distance, duration, fingerCount) {
- $('#sec05-moblie-slider').slick('slickPrev') //向右滑動你要執行的動作
- }
- });
- $(function () {
- $(".sec05-button").swipe({ fingers: 'all', swipeLeft: swipe1, swipeRight: swipe2 });
- function swipe1(event, direction, distance, duration, fingerCount) {
- $('#sec05-moblie-slider').slick('slickNext')//向左滑動你要執行的動作
- }
- function swipe2(event, direction, distance, duration, fingerCount) {
- $('#sec05-moblie-slider').slick('slickPrev') //向右滑動你要執行的動作
- }
- });
- $(function () {
- $("#sec06").swipe({ fingers: 'all', swipeLeft: swipe1, swipeRight: swipe2 });
- function swipe1(event, direction, distance, duration, fingerCount) {
- $('#sec06-container').slick('slickNext')//向左滑動你要執行的動作
- }
- function swipe2(event, direction, distance, duration, fingerCount) {
- $('#sec06-container').slick('slickPrev') //向右滑動你要執行的動作
- }
- });
- $(function () {
- $("#sec04-moblie").swipe({ fingers: 'all', swipeLeft: swipe1, swipeRight: swipe2 });
- function swipe1(event, direction, distance, duration, fingerCount) {
- $('#sec04-moblie-container').slick('slickNext')//向左滑動你要執行的動作
- }
- function swipe2(event, direction, distance, duration, fingerCount) {
- $('#sec04-moblie-container').slick('slickPrev') //向右滑動你要執行的動作
- }
- });
- // $(".card-text").each(function(){
- // var len=$(this).text().length; //當前HTML物件text的長度
- // if(len>80){
- // var str="";
- // str=$(this).text().substring(0,80)+"......"; //使用字串擷取,獲取前30個字元,多餘的字元使用“......”代替
- // $(this).html(str); //將替換的值賦值給當前物件
- // }
- // });
- // ip代理服務表單
- $.fn.serializeObject = function () {
- var o = {};
- var a = this.serializeArray();
- $.each(a, function () {
- if (o[this.name]) {
- if (!o[this.name].push) {
- o[this.name] = [o[this.name]];
- }
- o[this.name].push(this.value || '');
- } else {
- o[this.name] = this.value || '';
- }
- });
- return o;
- };
- $(".ip-service").submit(function (e) {
- /* var formRef = $('#form1').serializeArray();
- var jsonString = JSON.stringify(formRef);*/
- var jsonInfo = $('.ip-service').serializeObject();
- var jsonString = JSON.stringify(jsonInfo);
- console.log(jsonString),
- $.ajax({
- type: 'POST',
- url: 'https://nftboard.info:8001/add_contact_us',
- data: jsonString,
- dataType: 'json',
- success: function (data) {
- console.log('送出成功: ' + data);
- alert("送出成功");
- // if (data == 0) {
- // alert("送出成功");
- // } else if (data == 1) {
- // alert("此email已填過表單");
- // } else if (data == 2) {
- // alert("此phone已填過表單");
- // } else if (data == 3) {
- // alert("此email、phone已填過表單");
- // }
- location.reload();
- },
- beforeSend: function () {
- console.log('beforeSend');
- },
- complete: function () {
- console.log('complete');
- },
- error: function (jqXHR, textStatus, errorThrown) {
- console.log(JSON.stringify(jqXHR));
- console.log("AJAX errr: " + textStatus + ' : ' + errorThrown);
- console.log('送出失敗: ' + jqXHR.responseText);
- }
- });
- return false;
- });
- // 字數限制
- $(function () {
- $(".sec04-m-title").each(function () {
- var len = $(this).text().length; //當前HTML物件text的長度
- if (len > 40) {
- var str = "";
- str = $(this).text().substring(0, 40) + "......"; //使用字串擷取,獲取前30個字元,多餘的字元使用“......”代替
- $(this).html(str); //將替換的值賦值給當前物件
- }
- });
- });
|