简体   繁体   English

将滑块添加到博客帖子?

[英]Adding Sliders To Blog Posts?

I have found a JsFiddle similar to what I'm talking about, click here to see it. I发现了一个与我在说的相似的JsFiddle,请单击此处查看它。 I'm trying to add something similar to this on my site, but instead of the links that causes the posts to slide I would like an arrow. 我正在尝试在我的网站上添加与此类似的内容,但我希望使用箭头代替导致帖子滑动的链接。 Another arrow would have to appear to back to the previous blog post if the arrow to go to the next post is clicked. 如果单击了转到下一篇文章的箭头,则必须显示另一个箭头才能返回上一篇博客文章。 I don't know where to start programming this. 我不知道从哪里开始编程。 Does anyone know if I could just remove the links and turn them into arrows with just pure CSS? 有谁知道我是否可以仅使用纯CSS删除链接并将其转换为箭头?

Does anyone know if I could just remove the links and turn them into arrows with just pure CSS? 有谁知道我是否可以仅使用纯CSS删除链接并将其转换为箭头?

Yes you can. 是的你可以。

Edit You can refer to this fiddle for two options on making arrows, Demo . 编辑您可以参考此小提琴中的制作箭头的两个选项演示

Here is how you make a css triangle, 这是制作CSS三角形的方法,

a.btnL {
    border-right: 20px solid brown;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    height: 0;
    width: 0;
    display: inline-block; /* not needed but block is */
}

If you only want 2 triangles then you will need to rewrite your script due to how it is functioning. 如果只需要2个三角形,则由于其功能而需要重写脚本。

Here is an updated fiddle: Demo 这是更新的小提琴: 演示

You could do something like this: 您可以执行以下操作:

html: HTML:

<div class="post-container">
    <a href="#" class="arrow left"></a>
    <a href="#" class="arrow right"></a>
    <!-- Your post -->
</div>

css: CSS:

.post-container {
    position: relative;
}

.arrow {
    position: absolute;
    top: 10px;
}

.left {
    border-right: 20px solid blue;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    height: 0;
    left: -15px;
    width: 0;
}

.right {
    border-left: 20px solid blue;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    height: 0;
    right: 15px;
    width: 0;
}

And a working demo here: http://jsfiddle.net/kYH6S/1/ 这里还有一个工作示例: http : //jsfiddle.net/kYH6S/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM