Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Add RTL Support #756

Closed
mattyza opened this issue Jun 27, 2013 · 5 comments
Closed

Add RTL Support #756

mattyza opened this issue Jun 27, 2013 · 5 comments
Milestone

Comments

@mattyza
Copy link
Member

mattyza commented Jun 27, 2013

It would be useful if FlexSlider's JavaScript and CSS files catered for RTL (right to left) language.

This could be detected using the dir parameter, often added to the <html> tag, or whichever is the standard method for detecting an RTL language page.

@shadysamir
Copy link

I second this request

@opoepev
Copy link

opoepev commented Dec 18, 2014

I use v2.1 and you cna following step to try to fix it.
step 1: find

slider.prop = (vertical) ? "top" : "marginLeft";

change to

slider.prop = (vertical) ? "top" : ((vars.rtl) ? "marginRight" : "marginLeft");

step 2: find

return (posCalc * -1) + "px";

change to

return (posCalc * ((vars.rtl)?1:-1)) + "px";

step 3: find

slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"});

change to

slider.newSlides.css({"width": slider.computedW, "float": ((vars.rtl)?"right":"left"), "display": "block"});

step 4: find

slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});

change to

slider.slides.css({ "width": "100%", "float": ((vars.rtl) ? "right" : "left"), "marginRight": "-100%", "position": "relative" });

step 5: find

removed: function(){}           //{NEW} Callback: function(slider) - Fires after a slide is removed

}

change to

removed: function () {},           //{NEW} Callback: function(slider) - Fires after a slide is removed
// For RTL
rtl: false

}

step 6:
your javascript code must be

            $(element).flexslider(
            {
                rtl: true
            }

The default value of 'rtl' is false.
If you set value to true, flexslider will be rlt direction.

@jeffikus jeffikus closed this as completed Apr 1, 2015
@NabiKAZ
Copy link

NabiKAZ commented Jun 23, 2016

Please marge this patch into master branch of the project for core support RTL.

@jeffikus jeffikus added this to the 2.7.0 milestone Jun 23, 2016
@jeffikus
Copy link
Contributor

@NabiKAZ there already is an open RTL patch #1374 for the 2.7.0 cycle.

@jeffikus
Copy link
Contributor

Merged #1561 :)

@jeffikus jeffikus mentioned this issue Feb 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants