我使用的安德烈Ruffert的rangeslider.js上iDangerous'的顶部swiper.js但每次我滑,我初始化的rangeslider,它也刺激组队,探索的触摸滑动事件,因此两者都在同一时间滑动。当我滑动 Rangeslider 时,我可以使用任何方法禁用 Swiper?我是 jQuery 的新手,所以任何帮助将不胜感激。
这是我的代码:
HTML
<div class="swiper-container">
<div class="swiper-wrapper">
<!--First Slide-->
<div class="swiper-slide">
<input type="range" class="rangeslider"/>
</div>
<!--Second Slide-->
<div class="swiper-slide">
<h2>Slide 2</h2>
</div>
<!--Etc..-->
Run Code Online (Sandbox Code Playgroud)
JS
var mySwiper = $('.swiper-container').swiper({
mode:'horizontal',
loop: true
});
$('input[type="range"]').rangeslider({
polyfill: false,
// Callback function
onSlide: function(position, value) {},
// Callback function
onSlideEnd: function(position, value) {}
});
Run Code Online (Sandbox Code Playgroud) 我目前正在创建一个我正在创建的程序的问题.我已经找到了答案,但它与我想要发生的事情有所不同,因为这里给出的是字符串.
我们被要求创建一个FIFO分配,这是程序作为控制台应用程序的预期流程:
输入号码.页面框架:2
输入号码.要插入的页面数:4
要插入的页面:A
插入帧1.中断生成.
要插入的页面:B
插入帧2.中断生成.
要插入的页面:A
插入失败.A是常驻页面.
要插入的页面:C
插入帧1.中断生成.
根据FIFO分配算法,如果插入新的不同页面,它将删除插入帧中的最早页面.如果页面已经在框架中,则页面插入将被拒绝.
我已经做了一个,虽然我目前陷入困境,试图弄清楚如何在数组中找到最早插入的元素.
我希望你能帮助我.我已经花了很多时间,但我只是不知道该怎么做.这是我的代码:
class Program
{
static void Main(string[] args)
{
int f, p, interrupt;
Console.WriteLine("Enter the number of frames: ");
f = Int32.Parse(Console.ReadLine());
string[] frame = new string[f];
Console.WriteLine("Enter the number of pages: ");
p = Int32.Parse(Console.ReadLine());
for (int i = 0; i < p; i++) {
Console.WriteLine("Page to be inserted: ");
string x = Console.ReadLine();
if (frame.Contains(x))
{
Console.WriteLine(x + " is a resident page.");
} …Run Code Online (Sandbox Code Playgroud) allocation ×1
arrays ×1
c# ×1
fifo ×1
javascript ×1
jquery ×1
memory ×1
rangeslider ×1
swiper ×1