首页/ mobileweb/ 小草医院网络咨询管理系统 H5 移动端功能演示/ 代码预览

💻 代码预览 · 小草医院网络咨询管理系统 H5 移动端功能演示

mw_medical · 上传者 驰旭教育
← 返回详情
app.js · 约 766 字符
1/* 小草医院网络咨询管理系统 - 共享脚本 */2function setTop(title, sub, loc){3  const el = document.getElementById('topTitle');4  if(el) el.textContent = title || '小草医院';5  const subEl = document.getElementById('topSub');6  if(subEl) subEl.textContent = sub || '';7  const locEl = document.getElementById('topLoc');8  if(locEl) locEl.textContent = loc || '小草医院 · 互联网门诊';9}10function back(){ history.length>1 ? history.back() : (location.href='index.html'); }11/* 进入页面时高亮底部导航 */12document.addEventListener('DOMContentLoaded', function(){13  const cur = location.pathname.split('/').pop() || 'index.html';14  $all('#tabbar a').forEach(a=>{15    if(a.getAttribute('href')===cur) a.classList.add('on');16  });17});18