- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在常规 html 文档中处理旋转木马,当我将它放入 wordpress 时,旋转木马不会移动,我无法判断问题是否是因为 wordpress。代码与 html 文档中的相同。
我的代码:
var startingItem = 3;
$(document).ready(function() {
$('.carousel_data .carousel_item').each(function(){
$('#carousel').append( $(this).find('.image').html() );
});
createCarousel();
showCaption();
});
function createCarousel(){
$('div#carousel').roundabout({
startingChild: window.startingItem,
childSelector: 'img',
tilt: -0,
minOpacity:-1,
minScale: .5,
duration: 1200,
clickToFocus: true,
clickToFocusCallback: showCaption
});
createCustomButtons();
}
function createCustomButtons(){
$('.nextItem').click(function(){
hideCaption();
$('div#carousel').roundabout('animateToNextChild', showCaption);
});
$('.prevItem').click(function(){
hideCaption();
$('div#carousel').roundabout('animateToPreviousChild', showCaption);
});
$('div#carousel img').click(function(){
hideCaption();
});
}
function hideCaption(){
$('#captions').animate({'opacity':0}, 250);
}
function showCaption(){
var childInFocus = $('div#carousel').data('roundabout').childInFocus
var setCaption = $('.carousel_data .carousel_item .caption:eq('+childInFocus+')').html();
$('#captions').html(setCaption);
var newHeight = $('#captions').height()+'px';
$('.caption_container').animate({'height':newHeight}, 500, function(){
$('#captions').animate({'opacity':1}, 250);
});
}
.my_carousel { position: relative;
width: 100%;
margin: 0px;
/* background-color: #fff; */
/*margin: 5% auto 20px auto;*/
top: -100px;
z-index: -9999;}
.carousel_container { height: 350%; margin: 0px; width: 70%;
padding: 15% 0 7% 10%;}
#carousel { margin: 0px auto 0px auto; width: 100%; height: 40%; margin-left: 15%;}
#carousel img { width: 250px; height: 200px; cursor: pointer; border-radius: 5%; border: 4px solid black; padding: .5em;}
.nextItem { position: absolute; top: 23%; left: 0px; z-index: 1001; cursor: pointer; }
.prevItem { position: absolute; top: 23%; right: 0px; z-index: 1002; cursor: pointer; }
.caption_container { width: 100%;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
background: #173D50;
padding: 2em;
color: white;
/* margin-left: -22%; */ }
#captions h2 { font-family: Georgia; font-size: 32px; font-weight: normal; margin: 0px 0px 5px 0px; color: #6d8824; }
#captions p { font-family: Arial; font-size: 14px; margin: 0px 0px 0px 3px; }
.leaves { position: absolute; top: 270px; left: 102px; z-index: 1000; }
.carousel_data { display: none; }
.image {}
.caption_container {
height: 30%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/roundabout/2.4.2/jquery.roundabout.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="carousel_data">
<!-- begin items -->
<!-- Item -->
<div class="carousel_item">
<div class="image">
<img src="<?php bloginfo('template_url'); ?>/images/teapots_green.png" alt="teapot_green" />
</div>
<div class="caption">
<h2>iPhone Apps
</h2>
<p>Having your channel in the Apple app store is a sure sign your company and brand is moving forward. In 7 years Apple has sold 500 million iPhones and growing daily. Having your channel in the app store gives your channel access to a huge potential audience. We develop your TV channel into an app that is only a finger touch away from your audience. One click and your audience can access both your streaming, and VOD archived content. Go beyond an average channel and provide push notification to all your viewers, interact with your audience by allowing feedback through your app and much more. You are only limited by your imagination! Even more powerful is the ability to broadcast live events to your audiences iPhone (and all platforms we offer). If your ready to put your channel/business to the next level then get your iPhone app going today.</p>
<button class="btn">Contact us</button>
<button class="btn">Pricing</button>
</div>
</div>
<!-- Item -->
<div class="carousel_item">
<div class="image">
<img src="<?php bloginfo('template_url'); ?>/images/teapots_steel.png" alt="teapot_steel" />
</div>
<div class="caption">
<h2>Roku Channel Development</h2>
<p>Roku Channel Development Roku has over 12 million devices sold and millions tuning in to watch new and intriguing content. Tap into one of the fastest growing segment in video distribution. We develop custom ROKU channels that fit your needs. From VOD, STREAMING and more. We can produce netflix style apps or just simple streaming channels. Charge subscription fees or allow your video content free of charge it is all up to you and your creative mind! If one thinks about the difference in trying to start a cable channel verses a ROKU channel it becomes clear that ROKU is much more cost effective. Cable negotiations can be long and costly and can drag out for months or even years. Cable subscriptions are plummeting due to consumer options such as ROKU and FIRETV shifting the balance of content distribution and leveling the playing field from large mega corporations to anyone that can produce great content. Its time your business takes advantage of this growing segment. </p>
<a href="#popup1"><div class="placeholder"><h6>Video</h6></div></a>
<div id="popup1" class="overlay">
<div class="popup">
<h2>Here i am</h2>
<a class="close" href="#">×</a>
<div class="content">
<iframe src="xxxxxxxxx&id=955height=470&width=600" seamless="seamless" scrolling="no" frameBorder="0" width="600" height="470" > </iframe>
</div>
</div>
</div>
<button class="btn">Contact us</button>
<button class="btn">Pricing</button>
</div>
</div>
<!-- Item -->
<div class="carousel_item">
<div class="image">
<img src="<?php bloginfo('template_url'); ?>/images/teapots_gold.png" width="150" height="100" alt="teapot_gold" />
</div>
<div class="caption">
<h2>Internet TV</h2>
<p>Internet TV means different things to different people. However the universal term is to be understood as TV that you watch on the internet. The internet has a potential audience of billions of people and it is clearly understood that internet TV is the fastest growing TV market. With our Internet TV packages you can create your own internet TV channel on your own website (or we can create one for you) charge subscription, archive past shows and much more. More people watch TV on the internet than they do from satellite and cable combined. This is means that this is a huge potential for your company to reach huge audiences. Here is one of our sample sites www.dvtvonline.com for you to get an understanding of what we can do for you.</p>
<a href="#popup1"><div class="placeholder"> <h6>Video</h6></div></a>
<div id="popup1" class="overlay">
<div class="popup">
<h2>Here i am</h2>
<a class="close" href="#">×</a>
<div class="content">
<iframe src="xxxxxxxxx&id=960height=470&width=600" seamless="seamless" scrolling="no" frameBorder="0" width="600" height="470" > </iframe>
</div>
</div>
</div>
<button class="btn">Contact us</button>
<button class="btn">Pricing</button>
</div>
</div>
<!-- Item -->
<div class="carousel_item">
<div class="image">
<img src="<?php bloginfo('template_url'); ?>/images/teapots_orange.png" width="150" height="100" alt="teapot_orange" />
</div>
<div class="caption">
<h2>Android Apps</h2>
<p>Over 1 Billion Android devices sold! That should speak for itself why you want your channel/business on the Android platform and offered in the Google play store. Our service will take your TV channel and brand Id and wrap them up in a beautiful flexible app to include your Live, Streaming, and VOD/archived content. Send push notifications to all your viewers, interact with your viewers through feedback and even allow your viewers to post pictures to a gallery inside your app. Anything is possible and only limited by your imagination.</p>
<a href="#popup1"><div class="placeholder"> <h6>Video</h6></div></a>
<div id="popup1" class="overlay">
<div class="popup">
<h2>Android Apps</h2>
<a class="close" href="#">×</a>
<div class="content">
<iframe src="xxxxxxxxx&id=957&height=470&width=600" seamless="seamless" scrolling="no" frameBorder="0" width="600" height="470" > </iframe>
</div>
</div>
</div>
<button class="btn">Contact us</button>
<button class="btn">Pricing</button>
</div>
</div>
<!-- Item -->
<div class="carousel_item">
<div class="image">
<img src="<?php bloginfo('template_url'); ?>/images/teapots_blue.png" width="150" height="100" alt="teapot_blue" />
</div>
<div class="caption">
<h2>Google Chrome Cast</h2>
<p>Chrome Cast is catching on like a wild fire as millions of people are switching off their cable and satellite service and watching Chrome-Cast. Give your company and channel the chance to be seen by millions when we develop for you your own Chrome Cast app/channel. If you want to be seen as the next big thing, then you have to do big things and Chrome Cast is certainly that!</p>
<a href="#popup1"><div class="placeholder"> <h6>Video</h6></div></a>
<div id="popup1" class="overlay">
<div class="popup">
<h2>Here i am</h2>
<a class="close" href="#">×</a>
<div class="content">
<iframe src="xxxxxxxxx&id=955height=470&width=959" seamless="seamless" scrolling="no" frameBorder="0" width="600" height="470" > </iframe>
</div>
</div>
</div>
<button class="btn">Contact us</button>
<button class="btn">Pricing</button>
</div>
</div>
<!-- Item -->
<div class="carousel_item">
<div class="image">
<img src="<?php bloginfo('template_url'); ?>/images/teapots_iron.png" width="150" height="100" alt="teapot_iron" />
</div>
<div class="caption">
<h2>Amazon Fire TV</h2>
<p>FIRE TV Amazons version of IPTV and competition to ROKU is catching on rapidly. In fact Amazon FIRE TV is doing so well it is reported it could reshape the streaming market. With Amazon a international seller we can expect FIRETV sales to only increase not only domestically in the USA but also internationally. Fire TV is available in Germany, USA, Austria, and the United Kingdom. Having your own channel on FIRETV will greatly increase your exposure and distribution of your content to millions internationally. We develop FIRE TV that are only limited by your imagination. You can charge subscription fees or allow your content to stream for free. Fire TV is sold internationally through amazon.com and other retailers.</p>
<a href="#popup1"><div class="placeholder"><h6>Video</h6></div></a>
<div id="popup1" class="overlay">
<div class="popup">
<h2>Here i am</h2>
<a class="close" href="#">×</a>
<div class="content">
<iframe src="xxxxxxxxxid=958height=470&width=600" seamless="seamless" scrolling="no" frameBorder="0" width="600" height="470" > </iframe>
</div>
</div>
</div>
<button class="btn">Contact us</button>
<button class="btn">Pricing</button>
</div>
</div>
<!-- end items -->
</div>
最佳答案
您是否在 WordPress 主题中包含了主要的 jQuery 库? JS 轮播需要主 jQuery 库才能运行。
并且您需要在非冲突模式下正确地在 WordPress 中排队 Javascript 库;见https://developer.wordpress.org/themes/basics/including-css-javascript/以及该页面上的示例,即在您主题的 functions.php 文件中:
wp_enqueue_script( 'script', get_template_directory_uri() . '/js/myscript.js', array ( 'jquery' ), 1.1, true);
之后,如果轮播仍然无法工作,请使用浏览器中的开发工具查找并修复 Javascript 错误。
关于javascript - JS 轮播不会移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39067316/
我在我的应用程序中使用开源 iCarousel 来实现轮播控件。我使用的轮播类型是 iCarouselTypeRotary 并且图像在这种类型中线性排列。但是,我需要图像像所附图像中的旋转木马一样带来
有人看过像这样的 jQuery 3D 轮播教程吗? http://web.enavu.com/demos/3dcarouselwip/ 没有给出来源,但想知道是否有人有关于如何连续圈出 DIV 并调整
我正在开发一种使用相机自动拍摄照片的软件。我希望用户能够设置照片间隔。我希望它看起来和工作起来像某种轮播。 它应该是这样的: 当我滑动(或用鼠标拖动)时,它应该沿给定方向移动: 所选项目应始终位于中间
抱歉问了个愚蠢的问题。我正在寻找带有按钮的旋转木马。我在 Bootply 上找到了这个模板,它完全符合我的要求。我在开发方面还很陌生。 也许有人可以向我解释如何摆脱侧面滚动效果。我知道我必须向 Jav
我正在寻找一个可以处理表单元素的 jQuery 轮播风格插件。 这是我需要做的。 我有三个表单元素:两个常规文本框和一个文本区域。还有两个按钮,上一个和下一个。 单击下一步按钮时,文本框/文本区域会切
我想构建一个包含两个图像轮播的网页,并且我希望能够将图像从一个轮播拖动到另一个。 我已经有了与 jCarouselLite 一起使用的图像轮播:它使用两个 UL 元素来指定轮播的图像。这工作得很好。
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我有这段代码可以从数据库中获取轮播图片或视频 $stmt = $con->prepare("SELECT * FROM `Main`"); $stmt->execut
我需要做这个 slider ,我找到了一些代码并尝试了,但没有一个完全是 LIKE THIS .bloco03 img {
我的任务是制作 3 张图片的轮播/幻灯片,只能在移动设备上使用。在桌面上,这些图像将显示在 3 列中。有没有一种方法可以自动转换,而无需我创建两个不同的模块并根据屏幕尺寸隐藏/显示一个? 最佳答案 你
我需要在卡片轮播上创建这种效果。我使用 Owl Carousel ,我给了元素框阴影。但我坚持制作不同位置元素的效果,例如 3d 或任何名称。 这是我想做的 http://www.awesomescr
我已经盯着这段相同的代码看了大约 4 个小时,并尝试观看一些不同的教程。问题是 slider 加载,有 3 张幻灯片的空间,但它只显示第一张幻灯片。 所有图像加载良好(在浏览器中验证),但轮播不会更改
我的 carouse/slider 有问题,我已经做到了,上一张和下一张图片每边各占 25%,中央图片占 50% 宽度。问题是我能够更改左右图像的背景,但我似乎无法将相同的颜色应用于中间图像。我已经尝
我想一次放 5 张图片作为页面的背景,即一张图片会显示一小段时间(比如每张一秒钟),然后重复它们。 我想知道有没有办法用 CSS 或 JS 来做到这一点? 预先感谢您的帮助! 最佳答案 这也许就是您正
我正在寻找一个支持触摸、可拖动、响应式 jQuery 滚动条/幻灯片/轮播/ slider ,用于显示水平可滚动项目列表(例如, eshop、最近将照片添加到数据库等)。 它看起来类似于苹果应用程序商
我想要夹层画廊的 Bootstrap 轮播。基本上;我正在拉入所有图像,并且我想要单行三张图像轮播。这是我非常讨厌的一段工作代码;我真的很想让它适用于无限数量的图像。 {% if page.d
大家好,我有这段代码,我一直在为我的网站编写代码。我正在尝试实现一个轮播功能,其中一张图片在另一张图片之后滑动。我遇到的问题是图片不会滑动。这是我的代码在欢迎 Controller 的索引页面中的样子
我正在构建一个简单的轮播,一旦用户水平滚动,事件点就会改变事件状态。但是,当我滚动时,jQuery 左侧位置返回值没有改变: li_left = li.position().left; // this
我正在尝试将文本放在轮播 slider 中的图像下方,但现在文本出现在图像上,而不是下方。 它看起来像这样: 但我希望它看起来像这样: 这是我的代码: final CarouselSlider aut
我在使用 boostrap carousel 时遇到 CSS 问题 我只是想让它更高,我已经尝试了几个 css 但没有任何效果。代码是在这个 jsFiddle 中,http://jsfiddle.ne
我是一名优秀的程序员,十分优秀!