swiper移動端日曆-1

来源:https://www.cnblogs.com/zhyue93/archive/2018/01/17/swiper_3.html
-Advertisement-
Play Games

先上圖: 說明:這是基於移動端的,對於PC端瀏覽器支持不是很好(我測的結果是IE無效),另外這個swiper是4.x版本的 先引用css css樣式: 1 <style type="text/css"> 2 .container { width: 100%; } 3 /*頭部*/ 4 .top-da ...


先上圖:

  

說明:這是基於移動端的,對於PC端瀏覽器支持不是很好(我測的結果是IE無效),另外這個swiper是4.x版本的

思路:

 

 先引用css

<link href="css/bootstrap.min.css" rel="stylesheet" />
<!--這是字體圖標文件-->
<link href="font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="css/swiper.min.css" rel="stylesheet" />

css樣式:

 1 <style type="text/css">
 2     .container { width: 100%; }
 3     /*頭部*/
 4     .top-date { position: fixed; top: 0; left: 0; font-size: 50px; width: 100%; height: 180px; line-height: 180px; background-color: #959a9e; color: white; z-index: 1; }
 5         .top-date > .date-text { margin: 0 auto; display: block; width: 320px; }
 6         .top-date > .date-today { position: fixed; right: 50px; top: 25px; border-radius: 160px; background-color: #ea9b32; height: 130px; width: 130px; line-height: 130px; text-align: center; }
 7 
 8     /*頭部彈出日期選擇層*/
 9     .date-select { display: none; }
10     /*遮罩層*/
11     .mask-layer { width: 100%; height: 100%; background: rgba(0,0,0,0.4); position: fixed; top: 0; left: 0; bottom: 0; z-index: 10; }
12     .main { width: 800px; height: 500px; position: fixed; left: 50%; top: 50%; margin-left: -400px; margin-top: -350px; z-index: 15; background-color: white; border-radius: 15px; font-size: 60px; font-weight: normal; }
13         .main > h2 { margin: 0; padding: 35px 40px; font-size: 70px; font-weight: normal; color: red; }
14     .current-time { text-align: center; display: none; }
15 
16     i.split-line1 { height: 1px; width: 90%; display: block; background-color: #777474; left: 5%; position: absolute; }
17     i.split-line2 { height: 1px; width: 90%; display: block; background-color: #777474; left: 5%; /* top: 10%; */ position: absolute; margin-top: 100px; display: none; }
18     i.split-line3 { height: 1px; width: 90%; display: block; background-color: #777474; left: 5%; /* top: 10%; */ position: absolute; margin-top: 200px; }
19 
20     .swiper-box-li { width: 33%; text-align: center; position: absolute; overflow: hidden; max-height: 200px; color: blue; }
21         .swiper-box-li.year { left: 3%; }
22         .swiper-box-li.month { left: 37%; }
23         .swiper-box-li.date { left: 66%; }
24     .date-select .swiper-container { font-size: 100px; }
25     .date-select .swiper-slide { height: 100px; line-height: 200px; }
26     /*取消|今天|確定*/
27     .tc-bot { position: absolute; bottom: 0; left: 0; width: 100%; }
28         .tc-bot > div { float: left; width: 33%; text-align: center; /* padding: 10px 0; */ border-right: 1px solid #9e9a9a; font-weight: normal; margin-bottom: 20px; }
29     .tc-bot-left { /*margin-left: 1%;*/ }
30     div.tc-bot-right { border-right: none; }
31     /*日曆部分*/
32     .calendar { position: absolute; top: 180px; left: 0; width: 100%; font-size: 60px; }
33         .calendar .swiper-container { z-index: 0; }
34     /*星期*/
35     .week > ul { width: 100%; padding: 0; display: flex; height: 100px; list-style: none; margin: 0; }
36         .week > ul > li { display: flex; -webkit-flex: auto; justify-content: center; align-items: center; font-size: 50px; width: 140px; height: 140px; margin: 0 auto; text-align: center; }
37             .week > ul > li > a { color: black; }
38     /*日期*/
39     .days table { font-size: 50px; border-collapse: separate; border-spacing: 0 20px; color: #eca647; }
40         .days table > tbody > tr > td { width: 140px; height: 140px; position: relative; background-color: transparent; border-radius: 65px; }
41             .days table > tbody > tr > td > span { display: block; text-align: center; }
42                 .days table > tbody > tr > td > span.number { font-size: 55px; font-weight: 500; }
43                 .days table > tbody > tr > td > span.solar { font-size: 40px; }
44             /*選中的日期*/
45             .days table > tbody > tr > td.select-day { background-color: #30d8b1; color: white; }
46             .days table > tbody > tr > td.before-class:before { content: ''; height: 15px; width: 15px; position: absolute; background: #001fff; left: 62.5px; bottom: -10px; border-radius: 15px; }
47             .days table > tbody > tr > td.before-show:before { display: block; }
48             .days table > tbody > tr > td.before-hide:before { display: none; }
49             /*節日樣式*/
50             .days table > tbody > tr > td.fesrival { color: red; }
51     /*農曆*/
52     .Lunar-date { height: 100px; line-height: 100px; background-color: #c5c1c5; font-size: 50px; font-weight: normal; padding-left: 30px; color: white; }
53 
54     /*日程表*/
55     section.time-line { background-color: #c5c1c5; margin-top: 10px; color: white; }
56     .time-line > ul { list-style: none; padding-left: 150px; margin-bottom: 200px; max-height: 875px; overflow-y: scroll; }
57         .time-line > ul > li { height: 175px; border-bottom: 1px solid white; position: relative; }
58             .time-line > ul > li:before { content: ''; width: 25px; height: 25px; position: absolute; background-color: #989898; left: -80px; top: 80px; border-radius: 12.5px; }
59             .time-line > ul > li > div { display: block; height: 87.5px; }
60                 .time-line > ul > li > div:first-child > span { vertical-align: -webkit-baseline-middle; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block;	   

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 字元串方法字元串切割slicestrObj.slice(start[,end])參數為負,將它作為length+end處理,此處length為字元串的長度。 str.slice( 2)可以取字元串後兩位substringstrObj.substring(start[,end])  ...
  • 文章系國內領先的 ITOM 管理平臺供應商 OneAPM 編譯呈現。 您是網站管理員還是網頁開發人員?想創建超快速的網站嗎? 今天我們來看看 JavaScript,這項神奇而又複雜的技術。它使網站內容更加豐富,但常常出現的運行性能問題又降低了用戶的體驗。事實已經證明,最佳的終端用戶體驗能提升網站的轉 ...
  • 我們在上一篇文章中講到了JS中變數的概念,本篇文章講一下運算符和表達式。 ...
  • 1、children與childNodes children: 獲取子元素節點,無相容問題 childnNodes: IE:獲取子元素節點 非IE(chrome,Firefox等):獲取子節點,包括元素節點和文本節點 2、firstChild與firstElementChild firstChild ...
  • 1、absolute和float 擁有相同的特性表現: ①包裹性(容器應用之後,可以包裹裡面的內容); ②破壞性(內容應用之後,會破壞父容器) 2、absolute和relative absolute和relative是分離的,對立的。父容器是relative,子元素是absolute,可以限制子元 ...
  • 相信很多朋友在製作表單的時候,我們的編輯器會有下圖的相關提示吧 我們發現雖然這樣並不影響我們的正常使用,但是看著這樣的報錯提示總是很讓人心煩,那麼這到底是為什麼呢? 其實,這是因為編輯器建議我們在使用<input>標簽時,用相應的<lable>標簽對其進行標記。不想百度的同學可以繼續往下看嘍: <l ...
  • 在上一節中,最後返回了一個resolver,本質上就是一個Resolver對象: 這個對象的構造函數非常簡單,只是簡單的繼承了Tapable,並接收了fileSystem參數: resolve 而在make事件流中,調用的正是該類的原型方法resolve,現在可以進行看一眼了: 需要註意的是,該方法 ...
  • JavaScript基礎分為三個部分:ECMAScript(JavaScript的語法標準)、DOM(操作網頁上的元素的API)、BOM(操作瀏覽器部分功能的API) ...
一周排行
    -Advertisement-
    Play Games
  • .Net8.0 Blazor Hybird 桌面端 (WPF/Winform) 實測可以完整運行在 win7sp1/win10/win11. 如果用其他工具打包,還可以運行在mac/linux下, 傳送門BlazorHybrid 發佈為無依賴包方式 安裝 WebView2Runtime 1.57 M ...
  • 目錄前言PostgreSql安裝測試額外Nuget安裝Person.cs模擬運行Navicate連postgresql解決方案Garnet為什麼要選擇Garnet而不是RedisRedis不再開源Windows版的Redis是由微軟維護的Windows Redis版本老舊,後續可能不再更新Garne ...
  • C#TMS系統代碼-聯表報表學習 領導被裁了之後很快就有人上任了,幾乎是無縫銜接,很難讓我不想到這早就決定好了。我的職責沒有任何變化。感受下來這個系統封裝程度很高,我只要會調用方法就行。這個系統交付之後不會有太多問題,更多應該是做小需求,有大的開發任務應該也是第二期的事,嗯?怎麼感覺我變成運維了?而 ...
  • 我在隨筆《EAV模型(實體-屬性-值)的設計和低代碼的處理方案(1)》中介紹了一些基本的EAV模型設計知識和基於Winform場景下低代碼(或者說無代碼)的一些實現思路,在本篇隨筆中,我們來分析一下這種針對通用業務,且只需定義就能構建業務模塊存儲和界面的解決方案,其中的數據查詢處理的操作。 ...
  • 對某個遠程伺服器啟用和設置NTP服務(Windows系統) 打開註冊表 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer 將 Enabled 的值設置為 1,這將啟用NTP伺服器功 ...
  • title: Django信號與擴展:深入理解與實踐 date: 2024/5/15 22:40:52 updated: 2024/5/15 22:40:52 categories: 後端開發 tags: Django 信號 松耦合 觀察者 擴展 安全 性能 第一部分:Django信號基礎 Djan ...
  • 使用xadmin2遇到的問題&解決 環境配置: 使用的模塊版本: 關聯的包 Django 3.2.15 mysqlclient 2.2.4 xadmin 2.0.1 django-crispy-forms >= 1.6.0 django-import-export >= 0.5.1 django-r ...
  • 今天我打算整點兒不一樣的內容,通過之前學習的TransformerMap和LazyMap鏈,想搞點不一樣的,所以我關註了另外一條鏈DefaultedMap鏈,主要調用鏈為: 調用鏈詳細描述: ObjectInputStream.readObject() DefaultedMap.readObject ...
  • 後端應用級開發者該如何擁抱 AI GC?就是在這樣的一個大的浪潮下,我們的傳統的應用級開發者。我們該如何選擇職業或者是如何去快速轉型,跟上這樣的一個行業的一個浪潮? 0 AI金字塔模型 越往上它的整個難度就是職業機會也好,或者說是整個的這個運作也好,它的難度會越大,然後越往下機會就會越多,所以這是一 ...
  • @Autowired是Spring框架提供的註解,@Resource是Java EE 5規範提供的註解。 @Autowired預設按照類型自動裝配,而@Resource預設按照名稱自動裝配。 @Autowired支持@Qualifier註解來指定裝配哪一個具有相同類型的bean,而@Resourc... ...