How can the Twitter Bootstrap Carousel cycle function can be changed to cycle the items from right to left instead of left to right so it'll look normal in hebrew/arabic websites?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- Disable Browser onUnload on certain links?
- how to get selected text from iframe with javascri
use
instead of
in bootstrap 3
I did a different thing, was too lazy to stick to your solution (too verbose for me):
My settings: ASP.NET MVC, culture settings: Hebrew. My carousel instance sits under a div named "divTopNewsSlider". ".slideshow-prev" and ".slideshow-next" are the selectors for my prev and next icons.
Solution steps:
Determine the user's culture (I develop for a Content Management System, so I need to get the culture settings from the server).
Use it to determine the float direction of the carousel li elements.
Change the carousel slider's next and prev functionalities to their reverse, respectively.
In Razor:
In JavaScript:
Just override the cycle function with a similar function that calls prev instead of next:
How to reverse the Bootstrap carousel by CSS
I have a solution by CSS only. No new scripts. No alteration of the HTML.
Please check the result:
jsfiddle codepen bootply
For RTL Languages such as Persian, Arabic and Hebrew
In the bootstrap.js file, find & change this lines:
to:
also
to: