如何更改 jquery Flexslider 箭头设计?
How to change jquery Flexslider arrows design?
我正在尝试更改 css 文件中的 Flexslider 箭头设计,但失败了。
我正在提供我所做的和我想要的截图:D
或者有什么方法可以更改 flexslider 图标或字体?
这是我的作品:http://i.stack.imgur.com/4fgcU.png
这是我想做的:http://i.stack.imgur.com/zhxqI.png
<ul>
<li><a href="#" title="Previous"><span class="icon icon-arrow-left8"></span></a>
</li>
<li><a href="#" title="Next"><span class="icon icon-arrow-right8"></span></a>
</li>
</ul>
如果您不想触摸字体或添加包含与您的设计相匹配的图标的新字体,
您可以通过覆盖 css:
来实现类似的效果
.flex-direction-nav a {
display: block;
width: 40px;
height: 40px;
margin: -20px 0 0;
position: absolute;
top: 50%;
z-index: 10;
overflow: hidden;
opacity: 0;
cursor: pointer;
color: rgba(0, 0, 0, 0.8);
text-shadow: none;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
color: #fff;
background-color: #000;
border-radius: 50%;
text-align: center;
}
.flex-direction-nav a:before {
font-family: "flexslider-icon";
font-size: 20px;
display: inline-block;
content: '\f001';
color: #FFF;
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
line-height: 40px;
}
.flex-direction-nav .flex-next {
right: -50px;
text-align: center;
}
结果如下:
你可以使用fontawesome insteed flexslider字体,修改css比如这个例子:
.flex-direction-nav a:before {
font-family: 'FontAwesome';
font-size: 50px;
display: inline-block;
content: '\f053';
color: rgba(255, 255, 255, 0.9);
}
.flex-direction-nav a.flex-next:before {
content: '\f054';
}
当然你必须设置:
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
首先
我正在尝试更改 css 文件中的 Flexslider 箭头设计,但失败了。 我正在提供我所做的和我想要的截图:D 或者有什么方法可以更改 flexslider 图标或字体? 这是我的作品:http://i.stack.imgur.com/4fgcU.png 这是我想做的:http://i.stack.imgur.com/zhxqI.png
<ul>
<li><a href="#" title="Previous"><span class="icon icon-arrow-left8"></span></a>
</li>
<li><a href="#" title="Next"><span class="icon icon-arrow-right8"></span></a>
</li>
</ul>
如果您不想触摸字体或添加包含与您的设计相匹配的图标的新字体, 您可以通过覆盖 css:
来实现类似的效果.flex-direction-nav a {
display: block;
width: 40px;
height: 40px;
margin: -20px 0 0;
position: absolute;
top: 50%;
z-index: 10;
overflow: hidden;
opacity: 0;
cursor: pointer;
color: rgba(0, 0, 0, 0.8);
text-shadow: none;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
color: #fff;
background-color: #000;
border-radius: 50%;
text-align: center;
}
.flex-direction-nav a:before {
font-family: "flexslider-icon";
font-size: 20px;
display: inline-block;
content: '\f001';
color: #FFF;
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
line-height: 40px;
}
.flex-direction-nav .flex-next {
right: -50px;
text-align: center;
}
结果如下:
你可以使用fontawesome insteed flexslider字体,修改css比如这个例子:
.flex-direction-nav a:before {
font-family: 'FontAwesome';
font-size: 50px;
display: inline-block;
content: '\f053';
color: rgba(255, 255, 255, 0.9);
}
.flex-direction-nav a.flex-next:before {
content: '\f054';
}
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
首先