Created
February 25, 2015 14:24
-
-
Save hzoo/b20f604ddf44917ea0e7 to your computer and use it in GitHub Desktop.
Bookmarklet to toggleRTL (also adds rtl class to body)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var body = $("body"); | |
var dir = body.css("direction"); | |
if (dir === "") { | |
body.css("direction", "rtl"); | |
body.toggleClass('rtl'); | |
} else if (dir === "ltr") { | |
body.css("direction", "rtl"); | |
} else { | |
body.css("direction", "ltr"); | |
} | |
body.toggleClass('rtl'); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:!function(){var t=$("body"),s=t.css("direction");""===s?(t.css("direction","rtl"),t.toggleClass("rtl")):"ltr"===s?t.css("direction","rtl"):t.css("direction","ltr"),t.toggleClass("rtl")}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment