响应式完成
parent
e6a6f42f38
commit
a741cc6f18
10
js/script.js
10
js/script.js
|
@ -1,6 +1,6 @@
|
|||
$(function(){
|
||||
// 滑动页面更改头部效果
|
||||
if(screen.width <= 960){
|
||||
if(window.innerWidth <= 960){
|
||||
$('.header').addClass('header-white');
|
||||
}else{
|
||||
$(window).scroll(function(){
|
||||
|
@ -57,7 +57,7 @@ $(function(){
|
|||
window.location.href = $(this).data('url');
|
||||
}
|
||||
})
|
||||
if(screen.width <= 960){
|
||||
if(window.innerWidth <= 960){
|
||||
// 公司新闻切换
|
||||
var newsSwiper = new Swiper('.news-swiper',{
|
||||
loop:true,//开启循环播放
|
||||
|
@ -139,7 +139,7 @@ $(function(){
|
|||
}
|
||||
|
||||
// 尾部导航
|
||||
if(screen.width <= 960){
|
||||
if(window.innerWidth <= 960){
|
||||
$('.foot-left>.item>a').click(function(){
|
||||
if(!$(this).parent().hasClass('active')){
|
||||
$('.foot-left>.item').removeClass('active');
|
||||
|
@ -233,7 +233,7 @@ $(function(){
|
|||
|
||||
// 友邻市集活动切换
|
||||
if($('.market-swiper').length){
|
||||
if(screen.width <= 960){
|
||||
if(window.innerWidth <= 960){
|
||||
var marketSwiper = new Swiper('.market-swiper',{
|
||||
direction: 'vertical', //向上
|
||||
slidesPerView: "auto",
|
||||
|
@ -303,7 +303,7 @@ $(function(){
|
|||
|
||||
|
||||
// 手机端二级导航
|
||||
if(screen.width <= 960){
|
||||
if(window.innerWidth <= 960){
|
||||
if($('.sub-nav-bg').length){
|
||||
let parentWidth = $('.sub-nav-bg').width();
|
||||
let offsetLeft = $('.sub-nav>.active').offset().left;
|
||||
|
|
Loading…
Reference in New Issue