Git Product home page Git Product logo

swiper's Introduction

Get Started | Documentation | Demos

Financial Contributors on Open Collective Build status jsDelivr Hits tree-shakeable types included

Swiper

Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps.

Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the best experience and simplicity.

Sponsors

casino portugal online Route4Me Route Planner Automatenspieler Best Online Casino Australia Buy Youtube Views 100% Real & Cheap Uudet nettikasinot 2024 » Listaamme Suomen uudet kasinot buy instagram followers from skweezer.net Hit'n'Spin Bonus ohne Einzahlung Best SMM Panel In The World | Crescitaly.com Casino utan Svensk Licens 2023 automatenspielex online Nettikasinot 2022 | Löydä Luotettava & Turvallinen Nettikasino!
NonGamStopOdds casino sites Online Casino Test 2022 » 90+ Casinos von Experten geprüft! Online sports betting and casino at Parimatch India Casinos not on GamStop | Casino-Wise.com Casinos not on GamStop UK 🏆 NonGamStopWager.com Casino utan spelpaus Online Casinos Cyprus - CasinoAuditor Best Online Casinos in Canada Pay Someone to Write My Research Paper TikTok Expert: Buy TikTok Followers Nove Casino eSports at HellaGood Marketing agency
Dotcom-Monitor: Advanced Website Monitoring Solutions CasinosZonderCruksOnline Buy Instagram Likes Buy Tiktok Followers Buy Instagram Followers Buy Instagram Automatic Likes Inclave Casino Buy TikTok Views Famegear — Trace your favorite figure's fame through their gear Honrev — The Most Honest Product Reviews From Real Customer Experiences Buy TikTok Followers Online Casino Nederland
Get Organic TikTok Growth With Real Followers, Likes And Views My Coding Pal Hashtags For Likes Buy Instagram Followers Thunderclapit CreditCaptain – Leading AI Credit Repair Service Buy Google Reviews UK Casinos not on GamStop 2023 - nongamstopcasinos.net Buy TikTok Followers uaeonlinecasino.com Guidebook.BetWinner FitclubFinder CasinoOnlineCA
ZonderCruks - Online Gokken Zonder CRUKS Amazon Return Pallets BloodyCase Crypto Loko Free Chip No Deposit Online Kasyno Polis SMM Panel Services Provider RunLikes Best Bitcoin & Crypto Casino Sites SocialBoss Mejores Casinos Sin Licencia en España 91 Club SANCTIONS LAW FIRM
Interpol Law Firm try bookmakers not on GamStop The Red Playground Buy Instagram Followers & Likes Buy TikTok Likes With Free Trial CasinoRevisor: Alles über die besten Casinos in Deutschland Ai2people Accelerating Your Software Products | Teravision Technologies revistacomunicacion.org Casino Magyar Ta καλύτερα διαδικτυακά καζίνο στην Ελλάδα το 2024 $10 Deposit Casinos
SMM Panel : Best and Cheapest Smm Services in The World! Best sites to Buy Instagram Followers Buy Tiktok Followers Riversweeps Sweepstakes Software Bulkoid instagram profile viewer Gokken Online Cazino zonder Cruks buy youtube views Norska Casino HolyMolyCasinos Danske casino Sitio web con reseñas de los mejores casinos en línea de Chile
EarthWeb fb post likes Buzzoid.pro Bountii Coupons UseViral Buy Instagram Reels views Buitenlandse Online Casinos Greece Casinos Anonypro Chudovo Fortune Tiger Casino Bonussen Nederland
impltech Norsk casinoer på nett Trusted Online Store Review and Latest Coupon Code 2024 Casino No deposit Bonus 2024 Instasocials The best casino reviews, bonuses and slots Vapemaps Quickbooks Tool Hub Anonymous Instagram Story Viewer - Instanavigation Best sites to Buy Instagram Likes Jämför försäkringar Jogo Fortune Rabbit
Buy Instagram Likes - Real Likes & Instant Delivery! Vedonlyonti ilman rekisteroitymista Jogo Tiger Fortune – Jogo do Tigrinho para Ganhar Dinheiro All Bitcoin & Crypto Casino Trace a phone number within minutes Vedonlyontiyhtiot.com - Parhaat Vedolyöntiyhtiöt & Bonukset Purchase TikTok followers, likes and views Buy Youtube Views eBay Arbitrage Software UpGrow: #1 AI-Powered Instagram Growth | Real IG Followers Best Bitcoin Casinos SafeHamsters: The Pinnacle of Crypto Sports - SafeHamsters
buy instagram likes 90+ UK Casinos Not on Gamstop » Non GamStop Sites Topnoaccountcasinos casino zonder registratie Best Real Money Online Gambling Sites 2023 Čеské оnlinе kаsinо rесеnzе а hоdnосеní Utländska Casino | Bästa Casinon med Trustly, BankID & Zimpler Prointernet SVITUA Bruno Casino is a great online casino offering various bonuses for your favourite slot games. Nexus Smoke Premium E-Liquid and Luxury Vape Products Utländska Casino | Bästa Casinon med Trustly, BankID & Zimpler Overlyzer » football betting analyzer & soccer predictions
Founder Shield | Risk Management for High-Growth Companies Buy Instagram Follower & Likes | Dopoid Casino utan Svensk Licens | Bästa Casinon utan Spelpaus 🎖️ Casinomir UK - Your Guide to the World of Online Casinos Casinos Not On Gamstop UK: Where To Play Safely In 2023 Updated October Рayid Сasinos Withdrawal & Deposit in Аustralia - Best РayID Оnline Рokies Detectico Phone Tracker to Find Location by Phone Number AlphaRoot Онлайн казино 777 Україна Игровые автоматы BetFans - Alles over online wedden; Bookmakers Vergelijken Top USA Online Casinos September 2023 | Online United States Casinos
Buy Instagram Reel Views Gamble for Real Money at Honest Casinos - GambleDex Best Online Casino in Philippines using GCash | 2023 Rank Best Online Casinos in New Jersey Best Payout Casinos for Canadian Players Buy YouTube Subscribers & Views UK @ just £1.99 - Boostlikes Buy Twitter Followers – 100% Active & Instant Online Kaszinó Magyar, Legjobb Online Kaszinók 2023 UX Design & Software Development Company Buy Instagram Followers | Real, Instant Delivery & Only $2.97 BairesDev: Promoting Open Source for a Better Future Mines Aposta lll▷ Jogo da Bombinha Que da Dinheiro
siti non AAMS - outlookindia.com Technology, Security, Innovation, The Cyber World Now | Cyberogism Hosting Europe – Super fast support better than AI iGamingMI: Your Trusted Online Gambling Guide In Michigan Property for sale in Spain Scrap Car Removal Toronto | Best Cash For Scrap Cars up to $5,000 Pikakasinot 2023 | Löydä paras uusi pikakasino suomessa! Rahapelit Netissä Toukokuu 2023 - Paras Rahapeli Valikoima Buy Instagram Reels Views Best Online Casino NZ in 2023 - Online Gambling NZ Casinot: Katso mitkä ovat parhaat casinot netissä 2023 Onlinecasinosspelen.com site is dé nummer één gids, waardoor je gemakkelijk alle informatie van de top 10 online casino sites.
Sup! - Standups, Holidays, and Surveys for your team | Sup! Standup Bot Rotativka.com - Най-добрите онлайн казина в България Under 1 Hour Withdrawal Casinos in Australia - 2022 PA Online Casino - List of Best Casinos in Pennsylvania Casino Zonder Registratie 2022 | CZR's Top No Account Casino's Ranglijst Nieuwe Online Casino's December 2022 | Overzicht van de top nieuwe casinos! オンラインカジノ - OnlineCasinoWiki.com cricket betting app Pièces auto neuves au meilleur prix | MISTER AUTO Giochi online e non solo – A quale gioco vuoi giocare oggi? WiserGamblers | Best Online Gambling Guide Coupons, Promo Codes, October 2022 — Refermate
Buy Instagram Likes - Real, Instant Likes - $1/50! - MegaFamous betting sider 🥇 Best Australian Online Pokies. Trusted Online Casino Reviews 2022 Uudet kasinot Elokuu 2022 🥇 - Parhaat uudet nettikasinot The Casino Wizard » Best Casinos & (No) Deposit Bonuses 2022 Take My Online Class For Me? NoNeedToStudy.com Coupontoaster: August 2022 Discount Codes, Coupons, Promo Codes & Deals Fastest Payout Casinos in Canada [2022] Clique Studios - Creative Digital Transformation Buy TikTok Followers - 100% Real & Fast | Just $5.00 - SocialBoosting Rating of best betting sites in Australia Casinos Not on GamStop » Most Trusted Non GamStop UK Casinos ⭐️
Greece Golden Visa Aviator aposta ᐈ Jogo de avião Aviator The Most Popular Stuff On The Internet Buy Instagram views Correct Casinos | The Ultimate Guide to the Legit Online Casinos IB extended essay writing service Online Slots - UK Slot Games - 500 FREE Spins at Wizard Slots Red Dog Online Casino Fortune Games® | Free Spins No Deposit Slot Games | Online Slots LÅN PENGE NU | Hurtige Online lån 2021 | Klik her og Ansøg i dag Erik Kings Zamsino Bonus seiten Review of the best online casino in Italy
VPN for Chrome to Make Web Surfing 100% Safe CasinoExpo casino utan registrering Inkedin - The Online Gambling News Hub Ranking Bukmacherów Legalnych 2020. Bukmacher nr 1 to... The Best Online Casinos in the UK » Gambling Sites by Casinosters Deposit £10 Play with 30, 40, 50, 60, 70, or 80 Pounds✔️ GambLizard Instagram likes Buy 100% Cheap SMM Services - Instagram, YouTube, Twitter

Features

  • Tree-shakeable: Only modules you use will be imported into your app's bundle.
  • Mobile-friendly: It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps.
  • Library Agnostic: Swiper doesn't require any JavaScript libraries like jQuery, which makes Swiper much smaller and faster. It can be safely used with libraries such as jQuery, Zepto, jQuery Mobile, etc.
  • 1:1 Touch movement: By default, Swiper provides 1:1 touch movement interaction, but this ratio can be configured through Swiper settings.
  • Mutation Observer: Swiper has an option to enable Mutation Observer, with this feature Swiper will be automatically reinitialized and recalculate all required parameters if you make dynamic changes to the DOM, or in Swiper styles itself.
  • Rich API: Swiper comes with a very rich API. It allows creating your own pagination, navigation buttons, parallax effects and many more.
  • RTL: Swiper is the only slider that provides 100% RTL support with correct layout.
  • Multi Row Slides Layout: Swiper allows a multiple row slides layout, with a few slides per column.
  • Transition Effects: Fade, Flip, 3D Cube, 3D Coverflow.
  • Two-way Control: Swiper may be used as controller for any number of other Swipers, and even be controlled at the same time.
  • Full Navigation Control: Swiper comes with all required built-in navigation elements, such as Pagination, Navigation arrows and Scrollbar.
  • Flexbox Layout: Swiper uses modern flexbox layout for slides layout, which solves a lot of problems and time with size caclulations. Such layout also allows configuring the Slides grid using pure CSS.
  • Most Flexible Slides Layout Grid: Swiper has a lot of parameters on initialization to make it as flexible as possible. You can control slides per view, per column, per group, space between slides, and many more.
  • Images Lazy Loading: Swiper Lazy Loading delays loading of images in inactive/invisible slides until the user swipes to them. Such feature could make the page load faster and improve Swiper performance.
  • Virtual Slides: Swiper comes with Virtual Slides feature that is great when you have a lot of slides or content-heavy/image-heavy slides so it will keep just the required amount of slides in DOM.
  • Loop mode
  • Autoplay
  • Keyboard control
  • Mousewheel control
  • Nested sliders
  • History navigation
  • Hash navigation
  • Breakpoints configuration
  • Accessibility (A11y)
  • And many more ...

Community

The Swiper community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects

Our Code of Conduct applies to all Swiper community channels.

Dist / Build

On production use files (JS and CSS) only from dist/ folder, there will be the most stable versions.

Development Build

Install all dependencies, in repo's root:


$ npm install

And build development version of Swiper:


$ npm run build

The result is available in dist/ folder.

Running demos:

All demos located in ./playground folder. There you will find Core (HTML, JS), React, Vue versions. To open demo, run:

  • Core: npm run core
  • React: npm run react
  • Vue: npm run vue

Production Build


$ npm run build:prod

Production version will available in dist/ folder.

Contributing

All changes should be committed to src/ files only. Before you open an issue please review the contributing guideline.

Major Roadmapped Features

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

swiper's People

Contributors

andyburke avatar callumacrae avatar carnoisseur1979 avatar dann2012 avatar ekzobrain avatar fenyagg avatar ghaiat avatar greenkeeper[bot] avatar icek avatar imjohansunden avatar jasonlav avatar jenemde avatar jur-ng avatar justingrant avatar kochizufan avatar mya-ake avatar navyxie avatar nolimits4web avatar orbintsoft avatar robpop avatar rtabulov avatar sablinsergey avatar shashank1010 avatar stephanebachelier avatar tiagocavalcante avatar triloworld avatar tzvikaf avatar vltansky avatar weiz18 avatar ygj6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiper's Issues

Multiple swipers on one page

Thanks for a great script.

I have one question. I am trying to implement 2 swipers on my page. The first one works great but when i try copy the same code for my second swiper it wont work.

The 2 swipers should look the same so i use the same css.

So the html for the slider is the same.

This is my jquery code:

var mySwiper = new Swiper('.swiper-container', {pagination:'.pagination-sd'}, {
speed: 750,
mode: 'horizontal'
})

Here is my code: http://m.vasabladet.fi/new/jm/

How can i accomplish this?

Blurry text with "-webkit-transform: translate3d (0,0,0)"

Hello,
When I try to create a new slide, from an Ajax request.

The ajax returns me all the html content of a section (only the contents of the body)

success: function (data) {
vertical.createSlide newSlide = var (data);
newSlide.append ();
vertical.swipeTo (newSlide.index ());

The text is blurred.

blurry
blurry2

searching I found that this is a common problem when using
-webkit-transform: translate3d (0,0,0);
That is why the following line comment
. swiper-slide {
float: left;
/ *-webkit-transform: translate3d (0,0,0) * /

and now the text is displayed normally.

normal
normal2

I mention this as something you could consider.

related:
http://code.google.com/p/chromium/issues/detail?id=83475
http://stackoverflow.com/questions/6411361/webkit-based-blurry-distorted-text-post-animation-via-translate3d

Greetings!.

fixes for ie8 & firefox

Hope following helps for cross browser support =) Also thanks heaps for new looping support, is great.

firefox doesn't support .outerHTML, polyfill below with others

code for ie8
getTranslate method, append following

 || window.getComputedStyle(el, null).getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,");

setTransform method

            es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = 'translate(' + x + 'px, ' + y + 'px)';
            if (ie8)
                es.filter = 'progid:DXImageTransform.Microsoft.Matrix(Dx=' + x + ',Dy=' + y + ')';

and have the following polyfills

// polyfills
if (!window.addEventListener) {
    if (!window.Element)
        Element = function () { };

    Element.prototype.addEventListener = HTMLDocument.prototype.addEventListener = addEventListener = function (type, listener, useCapture) { this.attachEvent('on' + type, listener); }
    Element.prototype.removeEventListener = HTMLDocument.prototype.removeEventListener = removeEventListener = function (type, listener, useCapture) { this.detachEvent('on' + type, listener); }
}
if (document.body.__defineGetter__) {
    if (HTMLElement) {
        var element = HTMLElement.prototype;
        if (element.__defineGetter__)
            element.__defineGetter__("outerHTML", function () { return new XMLSerializer().serializeToString(this); } );
    }
}
if (!window.getComputedStyle) {
    window.getComputedStyle = function (el, pseudo) {
        this.el = el;
        this.getPropertyValue = function (prop) {
            var re = /(\-([a-z]){1})/g;
            if (prop == 'float') prop = 'styleFloat';
            if (re.test(prop)) {
                prop = prop.replace(re, function () {
                    return arguments[2].toUpperCase();
                });
            }
            return el.currentStyle[prop] ? el.currentStyle[prop] : null;
        }
        return this;
    }
}
var ie8 = (function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv != -1 && rv < 9;
})();

Destroy

Is there any way to Destroy the slider?
I want to add new content to the slider, thought about destroying it and afterwards create it once again.

Any other way to add slides?

Carousel

I would be nice to be able to use the slider as a carousel. Having options to set the number of items to slide at a time :)

Swiper Class

Is it possible to use the slider without the swiper class?

I'm trying to implement the slider into a CMS system and the best way to use it for my client would be to have the images within a ul, with each img inside an li.

It isn't really practical to ask them to add a class to each new slide they add.

I have tried adding the class at page load but this is just too slow and all the images are visible until the slider kicks in.

Styling troubles

Can you help me to understand what I'm experiencing?

idangerous.swiper-1.5.css
Slider size defined as 100% wide by 260px tall

mypage.html (temp inline styles)
body width matching slider width
.myslide class 300px wide by 148px tall with margins 20 10 20 0

What I get:
slides variable width wide by 240px tall with a 20px margin above (and presumably below), and 10px margin between slides

If I define the slider width & body width as 640px wide instead of 100% I get
213px wide by 240px tall with a 20px margin above (and presumably below), and 10px margin between slides

turn right

Hello
What is the way to make the slider turn right to left
can you help me?
Nice work

imageSlider.slideTo() in loop mode.

When loop mode is active and swipeTo is called after initialization it resets back to 0 index.

imageSwiper = new Swiper('.swiper-container',{ loop: true, simulateTouch: true });
imageSwiper.swipeTo(active); //active is at index 7

This will send it to index 7, however the if( params.loop ) condition is met and the slide is reset to 0 again which trumps the explicit index setting because it executes

setTimeout(function(){
_this.swipeTo(0,0);
},0)

Slider Height not flexible

I have

<div class='swiper-slide'>
    <div>Image</div>
    <div>Description</div>
</div>

Following setup for the responsive Swiper, the height no longer works.
If I set height to 100%, then I get whitespace caused by the slides stacking.
Height:auto , same result. It seems that a pixel value is always set, locking the height.
Am I missing an option or css that allows the height to flex?

Swiper : mySwiper.activeSlide states after removeSlide

var newSlide = mySwiper.createSlide(data);
if (mySwiper.slides.length >= 3) {
console.log("before remove : " + mySwiper.activeSlide);
mySwiper.removeSlide(0);
newSlide.append();
console.log("after remove : " + mySwiper.activeSlide);
} else {
newSlide.append();
}

I'm testing to apply your swipe plugin on my mobile board. Everything is perfect, but I have just one problem.
I want to maintain just three sliders for paging. So onSliderChangeEnd event called, I removed the first slider and appended new slider at the end of sliders. Problem is that mySwiper.activeSlide property is still point at the same index(it's next page) after removing the first slider. Do you have any solution for this case.
I really appreciate nice swipe plugin. Thank you :)

slide position not the same if script loaded in portrait or landscape

Hi,

And thanks for your plugin which is the best i've tried (and I tried a lot of them).

This behavior can be seen when slides are larger than the screen in portrait. I know i can resize them with media queries, but I need the full background for design purpose.

On ipad :

Load slides (1024px width and a centered background) in landscape : it's fine. Turn your device in portrait, still fine, background is centered (btw thanks, not a lot of slider can do this without failing in a way or another).

Load slides (1024px width and a centered background) in portrait : slides are not centered, we can see the left part.

Is it a normal behavior ?
Thanks !

initialSlide parameter with 3D Flow plugin?

Great work here overall!
Just wondering if you were planning to implement the initialSlide parameter a little more? I see that it works fine with the Slider script on its own, but breaks when used in coordination with the 3D Flow plugin. I get the following JS error on line 75 of the 3D Flow script file:

Uncaught TypeError: Cannot read property 'length' of undefined

bind jquery click/tap

Hi, i'm trying to bind a jquery click/tap event on an element inside "swiper-wrapper" but i not had success. I'm trying to use this swiper for make a menu, so i'm trying to bind the event on each item/slide of the swiper. The callback event onTouchStart not satisfies my needs, because on a swiper with "slidesPerSlide" in 2, the callback return the same index for both items as 1 slide.

Problem with Android

Hi everyone,

I develop this spyke:
http://edjansantos.com/teste/slider.html

Work fine in all browsers, except Android (Android Native or Chrome).
If you start the aplication and slide the box to right, all right, but, if you slide to down and after to up and slide to right the slider doesn't work anymore.

It happens because I start the scrolling of the page from the swiper container, if I use the margin outside the container to scroll to down or up the app work successfully.

I'm still working to discover this problem, but any help is welcome!

Thank you!

Edjan

How to create some elements?

I seeing this Swiper is useful. But It's not really good.
I want create next/prev arrow, And scrollCount
ex:
slidesPerSlide : 1 --> scrollCount: 1
slidesPerSlide : 2 --> scrollCount: 2
slidesPerSlide : 3 --> scrollCount: 3
.....
best regards

unable to scroll if slider is unfocused

It might be a general mobile devices bug, but still.
Swiper works only if you have 'focused' it (clicked on it before you scroll it sideways).
For example, if you scroll the page and then try to scroll the swiper, it won't respond, which would seem as if it is broken. But if you tap on it and then scroll, it responds.

Hope there is a way to fix it.
Your swiper is great though, thanks. :D

With Auto-play and Looping both on, it is skipping slides

With options set as:
var options={
speed : 600,
autoPlay : 5000,
loop : true,
slidesPerSlide : 1
}

The slides auto advance and loop; however, with a set of 3 slides, it advances from slide 1 to slide 3, skipping over slide 2.

need to use image slider inside the horizontal slider

I am developing a website and need to use the image slider(that movie one) inside my horizontal slider. Presently, it is not allowing me to do so functions are same. Is there any way around to achieve the same.

Disable automatic resizing

This might be a niche case but I needed the option to disable the automatic resizing of the slider on browser resize. I have amended the source, just wondered if you wanted me to fork the project or merge the changes into your release.

Great script by the way, thanks

Missing document mouseout handlers

Currently, if you drag an element on the swiper and release the mousebutton of the element, the swipe action is not being released. This can be fixed by adding a document mouseoutlistener when drag Starts

onSlideChangeEnd not firing on IE 9

Great plugin, thanks for making this available for free.

As title states, end event is not firing. This is verified on the sample /swiper-demos. In js/script.js add the following line to the first demo. "end" logs correctly in Firefox and Chrome, but not in IE.

function slideChangeEnd(){
  console.log("end");
}
$(function(){
  /* Main Slider */
  swiper = new Swiper('.swiper1', {
    pagination : '.pagination1',
    onSlideChangeEnd: slideChangeEnd
  });
});

After using swipeTo / swipeNext I can't swipe back

After using swipeTo, swiper does swipe to the requested slide but the transform coordinates are left (0, 0) so I can't swipe back (I can pull a bit and see that the slide does exist, but the slide jumps back)

I'm using History, to allow slide transitions through the address bar.

Following is the relevant code:

$(window).bind('hashchange', function(event) {
var hash = window.location.hash.slice(1);
var index = $(".swiper-slide").index($("#" + hash));
if (index != swiper.activeSlide) {
swiper.swipeTo(index, 500, false);
}
});

swiper = new Swiper('.swiper-container', {
speed: 250,
freeMode: false,
onSlideChangeEnd: function() {
History.pushState(null, null, "#" + $(".swiper-slide").get(swiper.activeSlide).id);
}
});

Your assistance will be much appreciated.

Thanks,
Ofir

IE 8 problems on 1.8 version, 1.6 was ok

Hello I'm getting a lot of problems on IE 8 with version 1.8, with 1.6 it was ok.
By tte way I made a small change on 1.8 version, I added _this.currentDirection so I can know the direction of the slide [toNext or toPrev].

Bug can be viewed at http://novo4.clinicasaleiro.com, my slides are 100% width.

Any tip?

Best regards
Captura de ecra 2013-02-4 a s 19 25 24

Fluid height

Can you please add a feature to inherit window height?

Add support for keyboard (left - right - up-down)

Hello
First of all, is an excellent plugin!. thank you very much for taking the time to share this plugin!

Designing a website, I had to add support for keyboard and do the following.

/* iniciacion swiper */
var horizontal = $('.horizontal').swiper({
simulateTouch:false, //evita que bloquee el input buscar
speed:1000

  });

var vertical = $('.vertical').swiper({
    mode: "vertical",
    simulateTouch:false, //evita que bloquee el input buscar
    speed:1000

  });

$(document).keydown(function(event) {
    if (event.which === 37) {
        horizontal.swipePrev();
    }
    if (event.which === 40) {
        vertical.swipeNext();
    }
    if (event.which === 39) {
        horizontal.swipeNext(); 
    }
    if (event.which === 38) {
        vertical.swipePrev();
    }
}); 

Works great in all browsers except Google Chrome on Linux.
When I try to go down to a third level vertically, it gets stuck on the second level.

It would be good to have native support for keyboard

Keyboard: true,

Sorry for my English.

Thank you!.

swipeTo function

There is an issue with the swipeTo function not updating the internal position properly. This causes the slider to get out of sync when the swipeTo function is called. E.g.

Slider is on slide 1
Use swipeTo to change to slide 3
Click previous button to go to the previous slide and you are returned to slide 1 and not slide 2 as I expected

I have fixed this by adding: _this.positions.current = newPosition;

Prevent default on hrefs inside the slider

When dragging with a mouse, if the current slide has a href it will then click through to that link when mouse up. Would love to see a return false; when the mouse has been clicked a dragged to fix this issue.

Thanks

feature

this is mostly a feature request...

*In my case i need to return the current class , or the current id.
they way i am doing it now is by grabbing the active slider id (slider.activeSlide)
then get the active slider $('.swiper-slide:nth-child('+slider.activeSlide+')') and then whatever i need, the id, class, value..

*also there needs to be a way to disable touch. ( never mind, i use onlyExternal:true)

mySwiper.params.simulateTouch = false;

var mySwiper = new Swiper('.swiper-container', {

simulateTouch:true,
onSlideChangeEnd : function() {
    if(mySwiper.activeSlide == 8){
     mySwiper.simulateTouch = false;   
    }else{
      mySwiper.params.simulateTouch = true;  
    }
    }

})

why do not run ? :/

Pull request continued

I recently issued a pull request regarding the the swipeTo function.

Whilst the code I submitted fixed the issue with the swipeTo function is breaks the swipeNext function. Can you please investigate this further please as I can't figure out how the two are linked.

For the time being I recommend that you remove the line of code I added.

If you need anymore information just let me know.

Thanks

nested horizontal swiper into vertical

hello,

thak you for your amazing work.

Is it possible to insert horizontal swiper into slide of vertical swiper and still have ability to swipe this parent vertical swiper. Because when I'm on slide with horizontal navigation i lost vertical vertical touch events.

Is there some way to make work horizontal and vertical events on same slide?

Thank you for your help.

Martin

Version 1.3 doesn't work on PhoneGap

So I added swiper to my html page and tested in a Chrome browser. Everything went perfect until I tested it in the Android emulator. Any idea why this is not working? What information can I provide you so you can debug it?

Dynamically add new slides to the slider, can't slide to them unless I resize window..

If I append new div elements with class swiper-slide on the div with class swiper-wrapper...
the slider does not seem to recognize them, I can not scroll to the new ones.., it stop on the one that was the last one before I appended the new ones..

However.., for some reason, if I just resize the browser window a little bit, the width parameter on the style attribute for the div with class swiper-wrapper gets updated, and then I can slide to the next one..

Any ideas on why this is happening and how to fix it?' Im using an ajax call to get the new data and append the new div elements.., I'm thinking I need to bind an event or something after the ajax call?' I couldn't find anything about this on the documentation..

Thanks a lot!

Destory issue..

Hi,
In my app I am loding the slider conent thru ajax.. so I want to destroy to slider when there is no slider content on the page to fix the following error in my browser console..

Uncaught TypeError: Cannot read property 'className' of null swiper.js:858
_this.updatePagination swiper.js:858
_this.updateActiveSlide swiper.js:837
_this.swipeNext swiper.js:698
(anonymous function)

-- I am using the slider like this:

var animationSpeed = 750;
var timeinterval = 5000;

    var projects = $('#projectsSlider').swiper({ 
        speed:animationSpeed, 
        mode:'horizontal',
        autoPlay: timeinterval,
        loop: true,
        pagination: '.projectsPagination',
    });

but when I do projects.distroy(); after the slider content removal from the page, nothing happenes. Please help!

Current Slide Index or Class?

Is there a way to know what the current slide or index is via the api? I'm not seeing anything being set in the dom nor is there anything obvious in the documentation. Let me know if I am missing something.

Paul

Scrolling behaviour incorect when slides appended

Running swiper on Windows Phone 8.
When appending a slide in code, the scrolling behaviour is not updated. So if I start with 1 slide hard-coded in the html and then append another slide in code, the scrolling behaviour still works as though there's only one slide - i.e. I can't scroll to the second slide.

IE9 support

Currently, although IE9 supports 2d transforms, the plugin does not work for this browser. The reason is that the plugin includes MS (notice the uppercase) notation which will be present on IE10. You can provide IE9 basic support by simply adding the additional ms (lowercase) notation to this lines :
Line 564

es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = 'translate3d('+x+'px, '+y+'px, '+z+'px)'

Line 567

es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = 'translate('+x+'px, '+y+'px)'

Line 574

es.webkitTransitionDuration = es.MsTransitionDuration = es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = duration/1000+'s'

Line 544

var transformMatrix = window.getComputedStyle(el, null).MozTransform || window.getComputedStyle(el, null).OTransform || window.getComputedStyle(el, null).MsTransform || window.getComputedStyle(el, null).msTransform || window.getComputedStyle(el, null).transform

Line 490

var events = ['webkitTransitionEnd','transitionend', 'oTransitionEnd', 'MSTransitionEnd','msTransitionEnd'];

determine the height

Hello
I have a Slider 2

$(function(){
    /* Carousel mode: */
    var swiperCar = $('.swiper-car').swiper({
        pagination : '.pagination-car',
        slidesPerSlide : 1
    });
    swiperCar.swipeTo(7);

    var swiperCar = $('.swiper-car2').swiper({
        pagination : '.pagination-car2',
        slidesPerSlide : 3
    });
    swiperCar.swipeTo(7);

})

What is the method to determine the height of each Slider alone, for example,
swiper-car high 100px
swiper-car2 high 300px

This (CSS) determine the height of each slides

/* Specify Swiper's Size: */
.swiper-container, .swiper-slide {
    width: 100%;
    height: 100px;
    text-align: right;
}

This assistance old

#30

Full screen on click

Hi folks,

Would be fantastic to have an option to make an image in the div full screen on click. I realize that your swiper is general purpose, but having the image be full screen would make it a most excellent photo gallery.

I've cobbled up my own using this: http://tutorialzine.com/2012/06/quick-tip-fullscreen-backgrounds/ and adding and removing classes, but I still need to figure out how to make it swipeable.

Just a feature request, definitely not a bug report.

Thanks.
Dan

Swiper with loop not working correctly with canvas element

When using the swiper with the first slide having a canvas, the canvas is not displayed when moving to the right, however it works when moving to the left. The slide with the canvas appears blank, touching over it will make it to appear again. Sample code:


  <script>
    function initialize() {
        initializeScroll();
        drawCircle();
    }  
    function drawCircle() {
        var c=document.getElementById("myCanvas");
        var ctx=c.getContext("2d");
        ctx.beginPath();
        ctx.arc(100,75,50,0,2*Math.PI);
        ctx.stroke();
    }   
    function initializeScroll() {
        var swiper = new Swiper('.swiper-container', {
        loop: true});
    }
    document.addEventListener('DOMContentLoaded', initialize, false);
</script>


<div class="swiper-container">
    <div id="swiperWrapper" class="swiper-wrapper">
        <div class="swiper-slide">
            <canvas id="myCanvas" width="320px" height="160px"></canvas>
        </div>
        <div class="swiper-slide">
            <img src=".\images\image1.jpg"/>
        </div>
        <div class="swiper-slide">
            <img src=".\images\image2.jpg"/>
        </div>
    </div>
</div>

Navigation with pagination.

Is there a way to change to certain slide when clicking on the corresponding pagination button?
I couldn't find it in the api docs.

If there isn't, I can do it and submit a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.