I did another thing, was too lazy to stick to your decision (too much for me):
My settings: ASP.NET MVC, culture settings: Hebrew. My copy of the carousel sits under the girl divTopNewsSlider. ".slideshow-prev" and ".slideshow-next" are selectors for my previous and next icons.
Solution Steps:
Define the culture of the user (I am developing for a content management system, so I need to get the culture settings from the server).
Use it to determine the direction of the float of carousel elements li.
Change the functionality of the next and prev carousel to their opposite, respectively.
In Razor:
@functions { Boolean IsRTL() { return this.CultureDictionary.Language.CultureAlias.ToLower().IndexOf("he-il") > -1; } }
In JavaScript:
<script type="text/javascript"> var isRTL = "@IsRTL()".toLowerCase() === 'true'; $(".slideshow .pager li").css("float", isRTL ? "right" : "left"); $(document).ready(function () { if (isRTL) { $(".slideshow-prev").click(function () { $("#divTopNewsSlider").carousel('next'); event.stopPropagation(); }); $(".slideshow-next").click(function () { $("#divTopNewsSlider").carousel('prev'); event.stopPropagation(); }); } }); </script>
source share