gpt4 book ai didi

php - 如何在 Wordpress 中制作信息图 "Wide"

转载 作者:太空宇宙 更新时间:2023-11-04 11:27:22 24 4
gpt4 key购买 nike

请问有这方面经验的人一个简短的问题。我正在为我的博客设计一个信息图,并注意到其他人有一个功能,可以通过单击按钮使信息图变为全宽模板。

这是一个例子:

https://blog.kissmetrics.com/science-of-brands-on-instagram/

如果您单击信息图,而不是直接转到图像页面,它会加载标题并将模板更改为全宽。我注意到 URL 查询转到了 ?wide=1。

这是 Wordpress 中的插件还是内置函数?任何帮助将不胜感激:-)

最佳答案

很难说它是一个插件还是模板只是自然地显示这样的点击图像,但我想我可能会考虑做一个 javascript。这样您在放大和成像时就不会离开页面。像这样:

演示: http://jsfiddle.net/8w0ay8xs/

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<style>
.mycol {
width: 500px;
border: 1px solid #000;
}
.myimg {
width: 500px;
}
.allwide {
position: absolute;
text-align: center;
margin: 30px auto;
left: 10px;
right: 10px;
display: inline-block;
width: 90%;
float:left;
box-shadow: 0px 0px 30px rgba(0,0,0,0.4);
border: 10px solid #FFF;
min-width: 700px;
}
</style>
<div class="mycol">
<h1>Infographic: The Science of Brands on Instagram</h1>
<p>No other social platform provides an experience as incredibly focused and engaging as Instagram. With just a bit of creativity and thoughtful measuring, you can make some Insta-magic for your brand. In this infographic, discover the trends behind the big-brand Instagram experience and learn how you can catapult your company to new heights.</p>

<p>Click on the infographic below to view a larger image:</p>
<img src="http://www.jpeg.org/images/jpeg-home.jpg" class="myimg" />
</div>
<script>
jQuery(document).ready(function() {
jQuery(".myimg").click(function() {
jQuery(this).toggleClass("allwide");
});
});
</script>

关于php - 如何在 Wordpress 中制作信息图 "Wide",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32282540/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com