热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何在没有css边界技巧的情况下制作一个有箭头的div?-Howtomakeadivwitharrowlikesidewithoutcssbordertricks?

Iwanttomakemenunavigationbarwithseveralinline-blocklielements,eachofthemmusthavearr

I want to make menu navigation bar with several inline-block li elements, each of them must have arrow-like right side. Like this: 0) { images[index - 1].src = "red-white-arrow.png"; } } function mouseoutText(index) { var currentText = document.querySelectorAll(".text")[index]; currentText.style["background-color"] = "rgb(237, 28, 36)"; currentText.style["color"] = "white"; var images = document.querySelectorAll(".image"); if (index >= 0) { images[index].src = ((images.length - 1 === index) ? "red-white" : "red-red") + "-arrow.png"; if (index > 0) { images[index - 1].src = "red-red-arrow.png"; } } } var lastIndex = -1; function mouseoverArrow(event, index) { if (!!event) { var x = event.offsetX; var y = event.offsetY; var height = 40; if (((y y)) || ((y >= height / 2) && (x > (height - y)))) { mouseoverArrow(null, index + 1); return; } } if (lastIndex !== -1) { mouseoutArrow(); lastIndex = -1; } lastIndex = index; var texts = document.querySelectorAll(".text"); if (index === texts.length) { return; } texts[index].style["background-color"] = "white"; texts[index].style.color = "red"; mouseoverText(index); } function mouseoutArrow() { if (lastIndex <0) { return; } var texts = document.querySelectorAll(".text"); if (lastIndex >= texts.length) { return; } texts[lastIndex].style.color = "white"; texts[lastIndex].style["background-color"] = "rgb(237, 28, 36)"; mouseoutText(lastIndex); lastIndex = -1; } function clk(index) { console.log("Element " + (lastIndex === -1 ? index : lastIndex) + " was clicked"); }

Some Text
Some Text
Some Text

I attach the useful pictures as well:

我附上有用的图片:

enter image description here enter image description here enter image description here enter image description here


推荐阅读
author-avatar
YOYO很快乐的傻瓜
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有