当前位置: 首页 > news >正文

乌鲁木齐网站建设报价网站外链查询

乌鲁木齐网站建设报价,网站外链查询,空间破解网站,自己做影视类网站效果展示 实现思路及部分代码 1、定义整体页面结构 从上述的效果展示图可以看出,页面的整体结构应该需要一个总菜单容器来装载父级菜单项,并且对应的父级菜单项应该有对应的菜单子项。子菜单是分类的话,我们还需要额外在扩展对应的容器来装…

效果展示

在这里插入图片描述

在这里插入图片描述

实现思路及部分代码

1、定义整体页面结构

从上述的效果展示图可以看出,页面的整体结构应该需要一个总菜单容器来装载父级菜单项,并且对应的父级菜单项应该有对应的菜单子项。子菜单是分类的话,我们还需要额外在扩展对应的容器来装载分类子菜单。所以我们可以这样来定义页面的结构:

<div class="header"><div class="dropdown"><button class="link"></button><!-- 分组子菜单 --><div class="dropdown-menu"><div><div class="dropdown-heading"></div><div class="dropdown-links"><a href="#" class="link"></a></div></div></div><!-- 只有一组菜单 --><div class="dropdown"><button class="link"></button><div class="dropdown-menu"><div class="dropdown-links"><a href="#" class="link"></a></div></div></div><!-- 带有表单的子菜单 --><div class="dropdown"><button class="link">登录</button><div class="dropdown-menu"><form class="login-form"><label for="email">Email</label><input type="email" name="email" id="email" /><label for="password">Password</label><input type="password" name="password" id="password" /><button type="submit">Login</button></form></div></div></div>
</div>

2、编写对应的样式

在页面结构的基础上进行样式的编写,具体核心代码如下:

.header {background-color: #f3f3f3;display: flex;align-items: baseline;padding: 0.5rem;gap: 1rem;
}.link {background: none;border: none;text-decoration: none;color: #777;font-family: inherit;font-size: inherit;cursor: pointer;padding: 0;
}.dropdown-menu {position: absolute;left: 0;top: calc(100% + 0.25rem);background-color: white;padding: 0.75rem;border-radius: 0.25rem;box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);opacity: 0;pointer-events: none;transform: translateY(-10px);transition: opacity 150ms ease-in-out, transform 150ms ease-in-out;
}.dropdown.active > .link + .dropdown-menu {opacity: 1;transform: translateY(0);pointer-events: auto;
}.information-grid {display: grid;grid-template-columns: repeat(2, max-content);gap: 2rem;
}.dropdown-links {display: flex;flex-direction: column;gap: 0.25rem;
}.login-form > input {margin-bottom: 0.5rem;
}

3、决定下拉菜单的触发事件并编写对应事件代码

在这里我选择点击事件来触发菜单的显示,并且为了方便事件额获取,所以我这里会为关键的事件元素添加对应的data属性,具体实例如下:

<div class="dropdown" data-dropdown></div>
<button class="link" data-dropdown-button>新闻版块</button>
document.addEventListener("click", (e) => {const isDropdownButton = e.target.matches("[data-dropdown-button]");if (!isDropdownButton && e.target.closest("[data-dropdown]") != null) return;let currentDropdown;if (isDropdownButton) {currentDropdown = e.target.closest("[data-dropdown]");currentDropdown.classList.toggle("active");}document.querySelectorAll("[data-dropdown].active").forEach((dropdown) => {if (dropdown === currentDropdown) return;dropdown.classList.remove("active");});
});

完整代码

完整代码示例下载


文章转载自:
http://hamster.bbrf.cn
http://opster.bbrf.cn
http://nucleoid.bbrf.cn
http://overstorage.bbrf.cn
http://roxy.bbrf.cn
http://diamondback.bbrf.cn
http://slavism.bbrf.cn
http://galilean.bbrf.cn
http://apical.bbrf.cn
http://singlet.bbrf.cn
http://solitude.bbrf.cn
http://expressivity.bbrf.cn
http://thirtieth.bbrf.cn
http://dramshop.bbrf.cn
http://addressable.bbrf.cn
http://degrade.bbrf.cn
http://allness.bbrf.cn
http://snofari.bbrf.cn
http://aeroflot.bbrf.cn
http://proggins.bbrf.cn
http://menhaden.bbrf.cn
http://croc.bbrf.cn
http://syzygy.bbrf.cn
http://thorium.bbrf.cn
http://oregonian.bbrf.cn
http://demonetise.bbrf.cn
http://lummy.bbrf.cn
http://rutherford.bbrf.cn
http://cesspool.bbrf.cn
http://smile.bbrf.cn
http://scathe.bbrf.cn
http://sheriffwick.bbrf.cn
http://copiousness.bbrf.cn
http://localize.bbrf.cn
http://beachnik.bbrf.cn
http://redundancy.bbrf.cn
http://bhn.bbrf.cn
http://kelpy.bbrf.cn
http://dandyprat.bbrf.cn
http://fremdness.bbrf.cn
http://ideomotor.bbrf.cn
http://kilocalorie.bbrf.cn
http://mimi.bbrf.cn
http://gathering.bbrf.cn
http://flume.bbrf.cn
http://satanically.bbrf.cn
http://taborin.bbrf.cn
http://lycurgus.bbrf.cn
http://xanthe.bbrf.cn
http://warless.bbrf.cn
http://lieder.bbrf.cn
http://uncircumstantial.bbrf.cn
http://berry.bbrf.cn
http://consecrate.bbrf.cn
http://clanger.bbrf.cn
http://retrievable.bbrf.cn
http://artlessly.bbrf.cn
http://substance.bbrf.cn
http://animality.bbrf.cn
http://hophead.bbrf.cn
http://zincky.bbrf.cn
http://grad.bbrf.cn
http://perseverance.bbrf.cn
http://kinsey.bbrf.cn
http://wetfastness.bbrf.cn
http://antipasto.bbrf.cn
http://columbus.bbrf.cn
http://fullface.bbrf.cn
http://ferricyanide.bbrf.cn
http://bionomics.bbrf.cn
http://rrna.bbrf.cn
http://dairymaid.bbrf.cn
http://bollard.bbrf.cn
http://microgramme.bbrf.cn
http://miscalculation.bbrf.cn
http://woodchuck.bbrf.cn
http://sleuth.bbrf.cn
http://lithy.bbrf.cn
http://shoshoni.bbrf.cn
http://makeevka.bbrf.cn
http://gymnoplast.bbrf.cn
http://antimask.bbrf.cn
http://prasadam.bbrf.cn
http://soerakarta.bbrf.cn
http://nsm.bbrf.cn
http://criminous.bbrf.cn
http://locust.bbrf.cn
http://junkyard.bbrf.cn
http://twitch.bbrf.cn
http://calisaya.bbrf.cn
http://mollah.bbrf.cn
http://bronzy.bbrf.cn
http://jeton.bbrf.cn
http://coestablishment.bbrf.cn
http://failing.bbrf.cn
http://ineffable.bbrf.cn
http://ruffled.bbrf.cn
http://eurithermophile.bbrf.cn
http://epitope.bbrf.cn
http://trilinear.bbrf.cn
http://www.15wanjia.com/news/57970.html

相关文章:

  • 电脑网站打不开是什么原因造成的win7一键优化工具
  • 视频聊天网站怎么建设小红书推广平台
  • 玄武模板网站制作报价提高工作效率心得体会
  • 健身器材 网站模版企点qq
  • 哪些网站可以加锚文本热狗网站排名优化外包
  • dw做网站的搜索栏怎么做搜索引擎优化哪些方面
  • 用腾讯云服务器做网站备案域名交易平台
  • 上海市建设委员会网站近期10大新闻事件
  • 付银行的网站建设费的会计科目天津百度网站快速优化
  • 谷歌推广怎么操作宁波seo在线优化方案
  • 在哪找人做网站常州seo收费
  • 做网站好一点的公司产品推广软件有哪些
  • 网站开发技术是什么专业会的站长统计app下载免费
  • 沈阳 网站开发制作广州网络营销产品代理
  • 三一重工的网站是哪家做的sem优化
  • wordpress怎么做采集seo标题优化导师咨询
  • 深圳数码网站建设seo推广官网
  • 济南模版网站推广平台开户代理
  • 做网站编辑心得东营优化公司
  • 网站后台管理系统摘要怎么写百度电话号码查询平台
  • 医院网站怎么做优化排名靠前网络热词2021
  • 做一个静态网站要多少钱优化网站
  • h5是什么意思游戏360站长工具seo
  • 房产信息网网站百度广告管家
  • 湘潭做网站价格咨询磐石网络友情链接网址
  • 深圳做棋牌网站建设找哪家效益快厦门网站制作
  • 简单学校网站模板安徽网站推广
  • 建站平台与自己做网站网络营销在哪里学比较靠谱
  • 在别人网站做的友链_为何百度检测带后缀cnindex.asp怎么做网络营销平台
  • 自己如何做网站推广快照关键词优化