123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- $(".responsive").slick({
- dots: true,
- slidesToShow: 1,
- slidesToScroll: 1,
- autoplay: true,
- autoplaySpeed: 3000,
- arrows: false,
- });
- // window.onload = () => {
- // $(".style_house_sec02_slide_list").slick({
- // dots: false,
- // slidesToShow: 5,
- // slidesToScroll: 3,
- // infinite: true,
- // // centerMode: true,
- // arrows: false,
- // prevArrow: '<button type="button" class="slick-prev"><i class="fas fa-chevron-left" style="font-size: 32px;color: #CC7DB7;transform: translateY(-10px);"></i></button>',
- // nextArrow: '<button type="button" class="slick-next"><i class="fas fa-chevron-right" style="font-size: 32px;color: #CC7DB7;transform: translateY(-10px);"></i></button>'
- // });
- // function img_size() {
- // $('.slide_img').each(function () { //jquery.each()循環讀取所有圖片
- // var height = $(this).height();
- // var width = $(this).width();
- // console.log(height)
- // if (height > 100) {
- // $(this).css({
- // 'width': 100 + 'px',
- // "margin": 'auto',
- // });
- // }
- // else {
- // $(this).css({
- // "margin-top": '30px',
- // });
- // }
- // });
- // }
- // img_size();
- // };
- // window.onload = () => {
- // 直式輪播圖動態更改高度
- function changeHeight() {
- let firstImg = $('.style_house_sec02_slide div:first-child img');
- let firstImgHeight = firstImg.css('height');
- $('.style_house_sec02_slide .vertical-img').css("height", `${firstImgHeight}`)
- }
- changeHeight();
- $(window).resize(function () {
- setTimeout(() => {
- changeHeight();
- }, 500)
- });
- $('.slide_single_img').each(function () { // jquery.each() 循環讀取所有圖片
- var height = $(this).height();
- var width = $(this).width();
- console.log(height)
- console.log(width)
- let x=(height/width)
- console.log(x)
- if (x > 1) {
- $(this).css({
- 'height': 500 + 'px',
- "margin": 'auto',
-
- });
- }else {
- }
- });
- $('.slide_img').each(function () { // jquery.each() 循環讀取所有圖片
- var height = $(this).height();
- var width = $(this).width();
- console.log(height)
- console.log(width)
- let x=(height/width)
- console.log(x)
- if (x > 1) {
- $(this).css({
- 'width': 100 + 'px',
- "margin": 'auto',
- "padding":"0px",
- });
- }else {
- $(this).css({
- "margin-top": '30px',
- // "margin": 'auto',
- "padding":"5px",
- });
- }
- });
- $('.slider-for').slick({
- slidesToShow: 1,
- slidesToScroll: 1,
- arrows: false,
- fade: true,
- asNavFor: '.slider-nav'
- });
- $('.slider-nav').slick({
- slidesToShow: 5,
- slidesToScroll: 3,
- asNavFor: '.slider-for',
- dots: false,
- // centerMode: true,
- focusOnSelect: true
- });
- // };
- $(document).on("click", ".article__readMore", function (event) {
- $('.bhouseweb_loc_sec02').css('height', 'auto');
- $('.article__readMore').hide();
- });
- $(document).on("click", ".bhouseweb_loc_type>a", function (event) {
- $(this).siblings().removeClass('select');
- $(this).toggleClass("select");
- });
- $(".bt_slogan_portfolio").click(function () {
- $(".bt_slogan_portfolio").fadeOut();
- });
- $(".bt_slogan").click(function () {
- $(".bt_slogan_portfolio").fadeIn();
- });
- // Navbar Icon
- function changeIcon(e) {
- const item = document.querySelector('[data-toggle-class]');
- item.className === "close-btn" ? item.className = "navbar-toggler-icon" : item.className = "close-btn";
- }
- window.onload = () => {
- $('.furniture_design_content .slider-for').slick({
- slidesToShow: 1,
- slidesToScroll: 1,
- arrows: false,
- fade: true,
- asNavFor: '.slider-nav'
- });
- $('.furniture_design_content .slider-nav').slick({
- slidesToShow: 3,
- slidesToScroll: 1,
- asNavFor: '.slider-for',
- focusOnSelect: true
- });
- };
|