initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// 右上角菜单按钮
|
||||
$('.navbar-toggler').on('click', function() {
|
||||
const expanded = $(this).attr('aria-expanded')
|
||||
if(expanded == 'false') {
|
||||
$(this).addClass('close-nav')
|
||||
}
|
||||
else {
|
||||
$(this).removeClass('close-nav')
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* home.html
|
||||
*/
|
||||
function updatePcImg() {
|
||||
const vw = document.body.clientWidth
|
||||
$('.pc-source').each(function() {
|
||||
const styl = this.getAttribute('style')
|
||||
if(vw > 767.98) {
|
||||
const url = this.getAttribute('data-pc-url')
|
||||
this.setAttribute('style', `background-image: url(${url})`)
|
||||
}
|
||||
else {
|
||||
this.setAttribute('style', styl)
|
||||
}
|
||||
})
|
||||
}
|
||||
updatePcImg()
|
||||
window.onresize = updatePcImg
|
||||
Reference in New Issue
Block a user