Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
evExpress WinForms擁有180+組件和UI庫(kù),能為Windows Forms平臺(tái)創(chuàng)建具有影響力的業(yè)務(wù)解決方案。DevExpress WinForms能完美構(gòu)建流暢、美觀且易于使用的應(yīng)用程序,無(wú)論是Office風(fēng)格的界面,還是分析處理大批量的業(yè)務(wù)數(shù)據(jù),它都能輕松勝任!
DevExpress WinForm 控件已正式發(fā)布v23.1版本,此版本全新升級(jí)HTML & CSS的可重用模板、增強(qiáng)Ribbon組件功能、新增Office 365樣式等,歡迎下載最新版體驗(yàn)!
DevExpress WinForms Subscription官方最新版免費(fèi)下載試用,歷史版本下載,在線文檔和幫助文件下載-慧都網(wǎng)
DevExpress WinForms HTML & CSS模板庫(kù)包括一組預(yù)先設(shè)計(jì)的模板,這些模板基于官方WinForms演示應(yīng)用程序中使用的模板。您可以“按原樣”使用這些模板,也可以根據(jù)需要進(jìn)行定制。當(dāng)然您也可以創(chuàng)建一個(gè)HTML & CSS模板,將模板保存到庫(kù)中,并在需要時(shí)在任何項(xiàng)目中使用它。
現(xiàn)在可以將圖像標(biāo)簽綁定到具有圖像名稱的數(shù)據(jù)源字段中,HTML模板檢查數(shù)據(jù)字段是否包含SVG或位圖。如果沒(méi)有,則模板在SvgImageCollection(分配給控件的htmlages屬性)中查找具有指定名稱的圖像。
HTML
<img class="icon" src="${IconName}"/>
DevExpress WinForms Ribbon控件附帶了一個(gè)全新的Office 365渲染樣式。
當(dāng)我們使用新的Office 365樣式時(shí),WinForm Ribbon控件在功能區(qū)表單的頂部顯示一個(gè)搜索框,并在 Ribbon UI的右下方顯示顯示功能區(qū)選項(xiàng)。
使用以下API在其他 Ribbon樣式中啟用新的UI增強(qiáng)功能:
Backstage View(后臺(tái)視圖)項(xiàng)目現(xiàn)在包括一個(gè)新的對(duì)齊選項(xiàng),此選項(xiàng)允許您將項(xiàng)目對(duì)齊到后臺(tái)視圖的頂部和底部,以及標(biāo)題欄和快速訪問(wèn)工具欄的左側(cè)和右側(cè)(當(dāng)它顯示在Ribbon控件下方時(shí))。
C#
backstageViewItem.Alignment = BackstageViewItemAlignment.Bottom;
新版本中實(shí)現(xiàn)了新的API來(lái)顯示受Office啟發(fā)的彈出式通知和警報(bào)。
新的API包括:
C#
using DevExpress.XtraBars.Ribbon;
void ShowMessage() {
RibbonMessageArgs args = new RibbonMessageArgs();
args.Caption = "What's New";
args.Text = "Explore new WinForms-related features we expect to introduce in our first major update this year (v23.1).";
args.Icon = MessageBoxIcon.Information;
args.Buttons = new DialogResult[] { DialogResult.OK };
args.Showing += Args_Showing;
Ribbon.ShowMessage(args);
Ribbon.MessageClosed += Ribbon_MessageClosed;
}
void Ribbon_MessageClosed(object sender, RibbonMessageClosedArgs e) {
if(e.Result == DialogResult.OK)
Data.Utils.SafeProcess.Start("https://community.devexpress.com/blogs/winforms/archive/2023/02/16/devexpress-winforms-roadmap-23-1.aspx");
}
void Args_Showing(object sender, RibbonMessageShowingArgs e) {
e.Buttons[DialogResult.OK].Caption = "Explore Roadmap";
}
Page header項(xiàng)(BarButtonItem和BarCheckitem)可以根據(jù)矢量皮膚中的背景顏色調(diào)整文本和SVG圖標(biāo)的顏色,背景色必須設(shè)置為皮膚顏色(在設(shè)計(jì)時(shí),切換到“DX Skins”選項(xiàng)卡來(lái)選擇皮膚顏色)。
更多DevExpress線上公開(kāi)課、中文教程資訊請(qǐng)上中文網(wǎng)獲取
天給大家分享的是Vue3系列之自定義桌面端對(duì)話框組件v3layer。
V3Layer 基于vue3.0構(gòu)建的多功能PC網(wǎng)頁(yè)端彈窗組件。擁有超過(guò)10+種彈窗類型、30+種參數(shù)配置,支持拖拽(自定義拖拽區(qū)域)、縮放、最大化、全屏及自定義置頂層疊等功能。
在main.js中引入v3layer組件。
import { createApp } from 'vue'
import App from './App.vue'
// 引入Element-Plus組件庫(kù)
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
// 引入彈窗組件v3layer
import V3Layer from './components/v3layer'
createApp(App).use(ElementPlus).use(V3Layer).mount('#app')
v3layer支持組件式+函數(shù)式兩種調(diào)用方式。
<v3-layer
v-model="showDialog"
title="標(biāo)題內(nèi)容"
content="<div style='color:#f57b16;padding:30px;'>這里是內(nèi)容信息!</div>"
z-index="2021"
lockScroll="false"
xclose
resize
dragOut
:btns="[
{text: '取消', click: () => showDialog=false},
{text: '確認(rèn)', style: 'color:#f90;', click: handleSure},
]"
/>
<template v-slot:content>這里是自定義插槽內(nèi)容信息!</template>
</v3-layer>
let $el = v3layer({
title: '標(biāo)題內(nèi)容',
content: '<div style='color:#f57b16;padding:30px;'>這里是內(nèi)容信息!</div>',
shadeClose: false,
zIndex: 2021,
lockScroll: false,
xclose: true,
resize: true,
dragOut: true,
btns: [
{text: '取消', click: () => { $el.close() }},
{text: '確認(rèn)', click: () => handleSure},
]
});
當(dāng)彈窗類型為 message | notify | popover,調(diào)用方法如下:
v3layer.message({...})
v3layer.notify({...})
v3layer.popover({...})
vue3.0中提供了app.config.globalProperties 或 app.provide 兩種方式掛載全局函數(shù)。
// vue2中調(diào)用
methods: {
showDialog() {
this.$v3layer({...})
}
}
// vue3中調(diào)用
setup() {
// 獲取上下文
const { ctx } = getCurrentInstance()
ctx.$v3layer({...})
}
// vue2中調(diào)用
methods: {
showDialog() {
this.v3layer({...})
}
}
// vue3中調(diào)用
setup() {
const v3layer = inject('v3layer')
const showDialog = () => {
v3layer({...})
}
return {
v3layer,
showDialog
}
}
v3layer支持如下30+參數(shù)靈活配置,實(shí)現(xiàn)各種彈窗場(chǎng)景。
|props參數(shù)|
v-model 是否顯示彈框
id 彈窗唯一標(biāo)識(shí)
title 標(biāo)題
content 內(nèi)容(支持String、帶標(biāo)簽內(nèi)容、自定義插槽內(nèi)容)***如果content內(nèi)容比較復(fù)雜,推薦使用標(biāo)簽式寫(xiě)法
type 彈框類型(toast|footer|actionsheet|actionsheetPicker|android|ios|contextmenu|drawer|iframe)
layerStyle 自定義彈窗樣式
icon toast圖標(biāo)(loading | success | fail)
shade 是否顯示遮罩層
shadeClose 是否點(diǎn)擊遮罩時(shí)關(guān)閉彈窗
lockScroll 是否彈窗出現(xiàn)時(shí)將body滾動(dòng)鎖定
opacity 遮罩層透明度
xclose 是否顯示關(guān)閉圖標(biāo)
xposition 關(guān)閉圖標(biāo)位置(left | right | top | bottom)
xcolor 關(guān)閉圖標(biāo)顏色
anim 彈窗動(dòng)畫(huà)(scaleIn | fadeIn | footer | fadeInUp | fadeInDown | fadeInLeft | fadeInRight)
position 彈出位置(auto | ['100px','50px'] | t | r | b | l | lt | rt | lb | rb)
drawer 抽屜彈窗(top | right | bottom | left)
follow 跟隨元素定位彈窗(支持元素.kk #kk 或 [e.clientX, e.clientY])
time 彈窗自動(dòng)關(guān)閉秒數(shù)(1、2、3)
zIndex 彈窗層疊(默認(rèn)8080)
teleport 指定掛載節(jié)點(diǎn)(默認(rèn)是掛載組件標(biāo)簽位置,可通過(guò)teleport自定義掛載位置) teleport="body | #xxx | .xxx"
topmost 置頂當(dāng)前窗口(默認(rèn)false)
area 彈窗寬高(默認(rèn)auto)設(shè)置寬度area: '300px' 設(shè)置高度area:['', '200px'] 設(shè)置寬高area:['350px', '150px']
maxWidth 彈窗最大寬度(只有當(dāng)area:'auto'時(shí),maxWidth的設(shè)定才有效)
maximize 是否顯示最大化按鈕(默認(rèn)false)
fullscreen 全屏彈窗(默認(rèn)false)
fixed 彈窗是否固定
drag 拖拽元素(可定義選擇器drag:'.xxx' | 禁止拖拽drag:false)
dragOut 是否允許拖拽到窗口外(默認(rèn)false)
lockAxis 限制拖拽方向可選: v 垂直、h 水平,默認(rèn)不限制
resize 是否允許拉伸尺寸(默認(rèn)false)
btns 彈窗按鈕(參數(shù):text|style|disabled|click)
++++++++++++++++++++++++++++++++++++++++++++++
|emit事件觸發(fā)|
success 層彈出后回調(diào)(@success="xxx")
end 層銷(xiāo)毀后回調(diào)(@end="xxx")
++++++++++++++++++++++++++++++++++++++++++++++
|event事件|
onSuccess 層打開(kāi)回調(diào)事件
onEnd 層關(guān)閉回調(diào)事件
v3layer彈窗模板
<template>
<div ref="elRef" v-show="opened" class="vui__layer" :class="{'vui__layer-closed': closeCls}" :id="id">
<!-- //蒙版 -->
<div v-if="JSON.parse(shade)" class="vlayer__overlay" @click="shadeClicked" :style="{opacity}"></div>
<div class="vlayer__wrap" :class="['anim-'+anim, type&&'popui__'+type, tipArrow]" :style="[layerStyle]">
<div v-if="title" class="vlayer__wrap-tit" v-html="title"></div>
<div v-if="type=='toast'&&icon" class="vlayer__toast-icon" :class="['vlayer__toast-'+icon]" v-html="toastIcon[icon]"></div>
<div class="vlayer__wrap-cntbox">
<!-- 判斷插槽是否存在 -->
<template v-if="$slots.content">
<div class="vlayer__wrap-cnt"><slot name="content" /></div>
</template>
<template v-else>
<template v-if="content">
<iframe v-if="type=='iframe'" scrolling="auto" allowtransparency="true" frameborder="0" :src="content"></iframe>
<!-- message|notify|popover -->
<div v-else-if="type=='message' || type=='notify' || type=='popover'" class="vlayer__wrap-cnt">
<i v-if="icon" class="vlayer-msg__icon" :class="icon" v-html="messageIcon[icon]"></i>
<div class="vlayer-msg__group"><div v-if="title" class="vlayer-msg__title" v-html="title"></div><div v-html="content"></div></div>
</div>
<div v-else class="vlayer__wrap-cnt" v-html="content"></div>
</template>
</template>
<slot />
</div>
<div v-if="btns" class="vlayer__wrap-btns">
<span v-for="(btn,index) in btns" :key="index" class="btn" :style="btn.style" @click="btnClicked($event,index)" v-html="btn.text"></span>
</div>
<span v-if="xclose" class="vlayer__xclose" :class="!maximize&&xposition" :style="{'color': xcolor}" @click="close"></span>
<span v-if="maximize" class="vlayer__maximize" @click="maximizeClicked($event)"></span>
<span v-if="resize" class="vlayer__resize"></span>
</div>
<!-- 優(yōu)化拖拽卡頓 -->
<div class="vlayer__dragfix"></div>
</div>
</template>
<script>
import { onMounted, onUnmounted, ref, reactive, watch, toRefs, nextTick } from 'vue'
import domUtils from './utils/dom.js'
// 索引,蒙層控制,定時(shí)器
let $index = 0, $locknum = 0, $timer = {}, $closeTimer = null
export default {
props: {
// ...
},
emits: [
'update:modelValue'
],
setup(props, context) {
const elRef = ref(null);
const data = reactive({
opened: false,
closeCls: '',
toastIcon: {
// ...
},
messageIcon: {
// ...
},
vlayerOpts: {},
tipArrow: null,
})
onMounted(() => {
if(props.modelValue) {
open();
}
window.addEventListener('resize', autopos, false);
})
onUnmounted(() => {
window.removeEventListener('resize', autopos, false);
clearTimeout($closeTimer);
})
// 監(jiān)聽(tīng)彈層v-model
watch(() => props.modelValue, (val) => {
// console.log('V3Layer is now [%s]', val ? 'show' : 'hide')
if(val) {
open();
}else {
close();
}
})
// 打開(kāi)彈窗
const open = () => {
if(data.opened) return;
data.opened = true;
typeof props.onSuccess === 'function' && props.onSuccess();
const dom = elRef.value;
// 彈層掛載位置
if(props.teleport) {
nextTick(() => {
let teleportNode = document.querySelector(props.teleport);
teleportNode.appendChild(dom);
auto();
})
}
callback();
}
// 關(guān)閉彈窗
const close = () => {
if(!data.opened) return;
let dom = elRef.value;
let vlayero = dom.querySelector('.vlayer__wrap');
let ocnt = dom.querySelector('.vlayer__wrap-cntbox');
let omax = dom.querySelector('.vlayer__maximize');
data.closeCls = true;
clearTimeout($closeTimer);
$closeTimer = setTimeout(() => {
data.opened = false;
data.closeCls = false;
if(data.vlayerOpts.lockScroll) {
$locknum--;
if(!$locknum) {
document.body.style.paddingRight = '';
document.body.classList.remove('vui__body-hidden');
}
}
if(props.time) {
$index--;
}
// 清除彈窗樣式
vlayero.style.width = vlayero.style.height = vlayero.style.top = vlayero.style.left = '';
ocnt.style.height = '';
omax && omax.classList.contains('maximized') && omax.classList.remove('maximized');
data.vlayerOpts.isBodyOverflow && (document.body.style.overflow = '');
context.emit('update:modelValue', false);
typeof props.onEnd === 'function' && props.onEnd();
}, 200)
}
// 彈窗位置
const auto = () => {
// ...
autopos();
// 全屏彈窗
if(props.fullscreen) {
full();
}
// 彈窗拖動(dòng)|縮放
move();
}
const autopos = () => {
if(!data.opened) return;
let oL, oT
let pos = props.position;
let isFixed = JSON.parse(props.fixed);
let dom = elRef.value;
let vlayero = dom.querySelector('.vlayer__wrap');
if(!isFixed || props.follow) {
vlayero.style.position = 'absolute';
}
let area = [domUtils.client('width'), domUtils.client('height'), vlayero.offsetWidth, vlayero.offsetHeight]
oL = (area[0] - area[2]) / 2;
oT = (area[1] - area[3]) / 2;
if(props.follow) {
offset();
}else {
typeof pos === 'object' ? (
oL = parseFloat(pos[0]) || 0, oT = parseFloat(pos[1]) || 0
) : (
pos == 't' ? oT = 0 :
pos == 'r' ? oL = area[0] - area[2] :
pos == 'b' ? oT = area[1] - area[3] :
pos == 'l' ? oL = 0 :
pos == 'lt' ? (oL = 0, oT = 0) :
pos == 'rt' ? (oL = area[0] - area[2], oT = 0) :
pos == 'lb' ? (oL = 0, oT = area[1] - area[3]) :
pos == 'rb' ? (oL = area[0] - area[2], oT = area[1] - area[3]) :
null
)
vlayero.style.left = parseFloat(isFixed ? oL : domUtils.scroll('left') + oL) + 'px';
vlayero.style.top = parseFloat(isFixed ? oT : domUtils.scroll('top') + oT) + 'px';
}
}
// 元素跟隨定位
const offset = () => {
let oW, oH, pS
let dom = elRef.value
let vlayero = dom.querySelector('.vlayer__wrap');
oW = vlayero.offsetWidth;
oH = vlayero.offsetHeight;
pS = domUtils.getFollowRect(props.follow, oW, oH);
data.tipArrow = pS[2];
vlayero.style.left = pS[0] + 'px';
vlayero.style.top = pS[1] + 'px';
}
// 最大化彈窗
const full = () => {
// ...
}
// 恢復(fù)彈窗
const restore = () => {
let dom = elRef.value;
let vlayero = dom.querySelector('.vlayer__wrap');
let otit = dom.querySelector('.vlayer__wrap-tit');
let ocnt = dom.querySelector('.vlayer__wrap-cntbox');
let obtn = dom.querySelector('.vlayer__wrap-btns');
let omax = dom.querySelector('.vlayer__maximize');
let t = otit ? otit.offsetHeight : 0
let b = obtn ? obtn.offsetHeight : 0
if(!data.vlayerOpts.lockScroll) {
data.vlayerOpts.isBodyOverflow = false;
document.body.style.overflow = '';
}
props.maximize && omax.classList.remove('maximized')
vlayero.style.left = parseFloat(data.vlayerOpts.rect[0]) + 'px';
vlayero.style.top = parseFloat(data.vlayerOpts.rect[1]) + 'px';
vlayero.style.width = parseFloat(data.vlayerOpts.rect[2]) + 'px';
vlayero.style.height = parseFloat(data.vlayerOpts.rect[3]) + 'px';
}
// 拖動(dòng)|縮放彈窗
const move = () => {
// ...
}
// 事件處理
const callback = () => {
// 倒計(jì)時(shí)關(guān)閉
if(props.time) {
$index++
// 防止重復(fù)點(diǎn)擊
if($timer[$index] !== null) clearTimeout($timer[$index])
$timer[$index] = setTimeout(() => {
close();
}, parseInt(props.time) * 1000)
}
}
// 點(diǎn)擊最大化按鈕
const maximizeClicked = (e) => {
let o = e.target
if(o.classList.contains('maximized')) {
// 恢復(fù)
restore();
} else {
// 最大化
full();
}
}
// 點(diǎn)擊遮罩層
const shadeClicked = () => {
if(JSON.parse(props.shadeClose)) {
close();
}
}
// 按鈕事件
const btnClicked = (e, index) => {
let btn = props.btns[index]
if(!btn.disabled) {
typeof btn.click === 'function' && btn.click(e)
}
}
return {
...toRefs(data),
elRef,
close,
maximizeClicked,
shadeClicked,
btnClicked,
}
}
}
</script>
v3layer支持自定義拖拽區(qū)域 (drag:'#aaa'),拖動(dòng)到窗口外 (dragOut:true)。支持iframe彈窗類型 (type:'iframe')。
配置 topmost:true 當(dāng)前窗口會(huì)保持置頂。
ok,基于vue3.0開(kāi)發(fā)pc端對(duì)話框組件就分享到這里。希望對(duì)大家有所幫助哈!
片畫(huà)廊組件是網(wǎng)站中常見(jiàn)的UI組件,尤其是在電商平臺(tái)的產(chǎn)品詳情頁(yè)上,它允許用戶通過(guò)縮略圖快速瀏覽和查看產(chǎn)品的多個(gè)圖片。本文介紹如何僅使用原生的js、css和html實(shí)現(xiàn)下面動(dòng)畫(huà)呈現(xiàn)的圖片畫(huà)廊組件。
首先創(chuàng)建HTML結(jié)構(gòu),包括主圖區(qū)域和下方導(dǎo)航區(qū)域,需要重點(diǎn)交代的是id為spec-list的div元素是縮略圖列表的容器,容器的position屬性是relative,設(shè)置了固定的寬度,overflow設(shè)置為hidden,這樣其子元素超過(guò)寬度的部分將不可見(jiàn),它就相當(dāng)于窗戶,提供了一個(gè)矩形的的可見(jiàn)視野。ul裝載所有的縮略圖,它的position屬性設(shè)置為absolute,這樣就可以基于其父元素設(shè)置偏移量,它的寬度大于父元素的寬度,這樣就通過(guò)設(shè)置left屬性實(shí)現(xiàn)左右滑動(dòng),在父窗口范圍內(nèi)的縮略圖將是可見(jiàn)的,這樣就實(shí)現(xiàn)了滑動(dòng)效果。
<div class="product-intro">
<div class="preview-wrap">
<div class="preview" id="preview">
<!-- 主圖顯示區(qū)域 -->
<div class="main-img" style="width: 460px; height: 460px;">
<img id="spec-img" alt="" src="./images/ai-generated-8833166_1280.webp"
style="width: 100%; height: 100%; object-fit: cover;">
</div>
<!-- 下方導(dǎo)航列表 -->
<div class="spec-list" style="width: 452px;">
<!-- 左側(cè)箭頭 -->
<a id="spec-forward" href="javascript:;" class="arrow-prev disabled">
<i class="sprite-arrow-prev">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" style="scale:2;">
<path fill="currentColor" fill-rule="evenodd" d="m15 4l2 2l-6 6l6 6l-2 2l-8-8z"/>
</svg>
</i>
</a>
<!-- 右側(cè)箭頭 -->
<a id="spec-backward" href="javascript:;" class="arrow-next">
<i class="sprite-arrow-next">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" style="scale:2;">
<path fill="currentColor" fill-rule="evenodd" d="m9.005 4l8 8l-8 8L7 18l6.005-6L7 6z"/>
</svg>
</i>
</a>
<!-- 縮略圖列表可見(jiàn)區(qū)域 -->
<div id="spec-list" class="spec-items"
style="position: relative; width: 380px; height: 58px; overflow: hidden;">
<!-- 縮略圖列表 -->
<ul class="lh" style="position: absolute; width: 456px; height: 58px; top: 0px; left: 0px;">
<li class="img-hover"><img alt="" src="./images/ai-generated-8833166_1280.webp" width="54" height="54"></li>
<li class=""><img alt="" src="./images/owl-50267_1280.jpg" width="54" height="54"></li>
<li class=""><img alt="" src="./images/seal-8834240_1280.webp" width="54" height="54"></li>
<li class=""><img alt="" src="./images/stork-8830107_1280.webp" width="54" height="54"></li>
<li class=""><img alt="" src="./images/triggerfish-8832563_1280.webp" width="54" height="54"></li>
<li class=""><img alt="" src="./images/ai-generated-8834126_1280.webp" width="54" height="54"></li>
</ul>
</div>
</div>
</div>
</div>
</div>
.product-intro {
position: relative;
z-index: 1;
margin-top: 10px;
padding-bottom: 10px
}
.product-intro .preview-wrap {
float: left;
padding-bottom: 15px;
position: relative;
zoom:1;
z-index: 7
}
.preview {
position: relative
}
.preview .main-img {
border: 1px solid #eee;
margin-bottom: 20px;
zoom: 1
}
.preview svg {
color: #CCCCCC;
}
.preview .spec-list {
margin-bottom: 18px;
position: relative;
zoom: 1
}
.preview .spec-list ul {
margin: 0;
transition: left 0.5s ease;
list-style-type: none;
padding-left: 0;
}
.preview .spec-list .arrow-next,.preview .spec-list .arrow-prev {
display: block;
width: 22px;
height: 32px;
float: left;
position: absolute;
cursor: pointer;
top: 50%;
margin-top: -16px
}
.preview .spec-list .arrow-next i,.preview .spec-list .arrow-prev i {
display: block
}
.preview .spec-list .arrow-prev {
left: 0
}
.preview .spec-list .arrow-prev:hover i svg {
color: #999999;
}
.preview .spec-list .arrow-prev.disabled i svg {
color: #DFDFDF;
}
.preview .spec-list .arrow-next {
right: 0
}
.preview .spec-list .arrow-next:hover i svg {
color: #999999;
}
.preview .spec-list .arrow-next.disabled i svg {
color: #DFDFDF;
}
.preview .spec-items {
width: 224px;
margin: 0 auto;
overflow: hidden
}
.preview .spec-items ul {
width: 2000px
}
.preview .spec-items ul li {
float: left;
margin: 0 9px;
max-width: 60px;
max-height: 70px
}
.preview .spec-items ul li img {
border: 2px solid #fff;
padding-bottom: 1px
}
.preview .spec-items ul li.img-hover img,.preview .spec-items ul li:hover img {
border: 2px solid #e53e41
}
.preview #spec-img {
max-height: 600px;
}
.preview .spec-list .spec-items {
width: 390px
}
js主要處理鼠標(biāo)hover到縮略圖更新主圖區(qū)域圖片的src屬性值,以及縮略圖的紅色邊框效果;以及實(shí)現(xiàn)左右側(cè)箭頭點(diǎn)擊產(chǎn)生的縮略圖列表左右滑動(dòng)效果、箭頭失效處理,注意js中是直接設(shè)置ul的left屬性值,要實(shí)現(xiàn)滑動(dòng)的動(dòng)畫(huà)效果,需要在css樣式中設(shè)置transition屬性為left 0.5s ease,否則就不會(huì)產(chǎn)生動(dòng)畫(huà)效果。
*請(qǐng)認(rèn)真填寫(xiě)需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。