jquery mb.flipText

Never needed to flip your text vertically?

jquery.mb.flipText is a simple plug-in to turn your text vertically in both direction: top-bottom or bottom-top.Wasn’t that something you would have done on your HTML pages?

demo page:

http://pupunzi.com/#mb.components/mb.flipText/flipText.html

jQuery project page:
http://plugins.jquery.com/project/mbFlipText

download example:

http://mbideasproject.googlecode.com/files/jquery.mb.flipText.1.0.zip

documentation:

http://code.google.com/p/mbideasproject/wiki/mbFlipText

PayPal

Comments
39 Responses to “jquery mb.flipText”
  1. mohammad says:

    Please expressions from right to left does not support! Help me

    • james says:

      i’m using this and i think it’s fantastic. an example of what i used it for is here: http://elinbrita.com/

      one thing i would say is that it doesnt handle some html characters well, hyphens in wordpress titles and accented characters don’t render properly. Is there something I’m doing wrong in that respect?

      anyway, regardless of that its really really great work, congratulations

      • Hi James,
        This could depend by the char encoding of your page; try sing the UTF-8 encodinng ( or if HTML5).
        Bye,
        Matteo

      • james says:

        utf-8encoding is set on both the page, in htaccess, and the DB, but its no big deal really. One thing i did have an issue with was that if you resize the text via page zoom, you get scrollbars around the text which makes it unreadable (firefox is fine, but chrome and safari have this issue)

        It’s not a massive problem, but for mac users it can be a bit of a pain if your trackpad is set up to zoom. I have tried crazy amounts of css to remove scrollbars from the object element and it’s children, but nothing seems to work. I havent found any way to detect font size changes using a zoom either.

        I was wondering if future developments of this plugin might be able to detect this change at all?

        Anyway, as i mentioned before, great work. Not only for this plugin but also for some of the other interesting projects you’ve been working on!

  2. mohammad says:

    I am using the language of middle Asia but does not support this technique for flip text you help me please!

    • Hi Mohammad,
      actually i’ve no support for RL; This component is replacing the text with an SVG embed element; I’m going to see if SVG support RL in a simple way and how to apply to jquery.mb.fliptext component.
      Anyway if you can improve it you are wellcome!
      Bye,
      Matteo

      • TDJ says:

        Doesn’t seem too difficult to apply RTL to SVG text.. a number of examples at W3C: http://www.w3.org/International/tests/svg/test-direction-alignment-0

        Nice extensions btw :)

      • I would really appreciate help on improving such feature… if you have a solution post me your code.
        Thnx,
        Matteo

  3. Ryan says:

    Hi There, Is there any way to create a new line vertical text?

    • Hi Ryan,
      wrap each of your lines into SPANs, give a class and set font, color and size for the text; set the display as “inline-block” or “float: left”; init those line with mbFlipText().
      It should work.
      Bye,
      Matteo

  4. thePrimeRob says:

    Why can’t font-weight be controlled via css?

    • I think this could be an SVG limitation… don’t know why.

      • David says:

        Hey Matteo,

        Thanks for the reply. It’s still a very cool plug-in, and is a much easier and comprehensive way to get vertical text among a broad spectrum of browsers. Thanks for your effort!

  5. David says:

    Hey Matteo,

    I am having some trouble getting the bold font weight applied to the vertical text after it’s flipped.

    I modified the .js file to add a fontweight:bold parameter when building you are building the placeholder, but that didn’t resolve it either. Basically they show up bold, and as soon as they rotate, the bold is gone. Is this a limitation with the plugin, svg transform, or am I not doing something correctly?

    Any help you can give would be greatly appreciated!

  6. Andrei says:

    Hei Mateo,

    Very nice plug-in, thank you. I was wondering if your method can be adapted to rotate text to a custom degree, not only 90 and -90. Thank you.

    • Hi Andrei,
      actually it can be rotated just by 90°, sorry…
      Bye,
      Matteo

  7. Seb says:

    Hi,

    Is anyone having trouble getting this to work in Safari Mac.

    I have got it working, but it doesn’t appear every time i refresh the page or go to a new page… like one time it will show the text (rotated) then i hit refresh and its gone!, hit refresh and it might come back!

    Very weird?!?!

  8. Jonne says:

    Hi, I spend some time doing this myself, but when I found your plugin I was done immediately :) Love jQuery and all of its plugins. One thing though … why did you include that (div class=’pointer’ .. /) ? I use your plugin for texts in table headers and the (div) I mentioned is over the complete table and I was not able to click anywhere anymore. Works fine without the (div), but I guess it was there for a reason? Thanks.

    • Hi Jonne,
      I introduced the “pointer” DIV because Safari was unable to catch any event binded to the SVG element or to it’s container and this solved the problem. You had problems because the container of your rendered text needs a position:”relative”; this way the “pointer” DIV remains inside the text area. Anyway you can remove it if you don’t need it.
      Bye,
      Matteo

  9. dsub says:

    I wonder if the if-statment on line 65 has a bug in it:
    var cssPos= $(this).css(“position”)!=”absolute” || $(this).css(“position”)!=”fixed” ?”relative” : $(this).css(“position”);

    Should be:

    var cssPos= $(this).css(“position”)!=”absolute” && $(this).css(“position”)!=”fixed” ?”relative” : $(this).css(“position”);

    Otherwise you cant get either absolute or fixed position.

    • Hi dsub,
      it’s a bug,
      will be fixed in next release.

      thnx,
      Matteo

  10. John says:

    It’s not working very well in Safari version 4.1.3

    Text is rotated but it’s highlighted with black for some reason. My text is gray but after it’s rotated, it’s suddenly enclosed in a box filled with black! not so nice.

    Thanks.

    • Dan Connor says:

      I am also having the same black box issue with flipped text in Safari. Investigating…

      • Dan Connor says:

        The solution is to explicitly style the specific element being flipped. The mbFlipText javascript extracts the css color from the element and defaults to black if there is none. So, even though the element behind your text is gray the element itself has an undefined css background color. So set your element’s bg color to grey and you’ll be good to go.

      • Hi Dan,
        Yes, I had to add the background to the svg element because Webkit doesn’t accept transparency on text box elements; this is a work around, any good suggestion is wellcome.

        Bye,
        Matteo

  11. davide says:

    Hi Matteo, very usefull plugin, great work!
    I have problems when I print pages (such as reports). Print preview is ok, but with various printer driver (also pdfcreator) flip text is reflected and/or blended.
    Is there a workaround?
    thanks

    • Hi Davide,
      I don’t have workarounds for this problem,
      I’ve no such problem working on Os x, I can print as PDF or on paper correctly;
      I’ll make some test on Windows platform to reproduce your issue and see if there’s a solution.
      I’m sorry,

      Ciao,
      Matteo

  12. Joydev says:

    I am not able to make the text bold how can I do that.

    • I’ve tried to implement this but seams that SVG can’t render BOLD text adding font-style=\”bold\” to the TEXT tag of the embed.
      If you findout the way please let me know.
      Bye,
      Matteo

  13. Boson says:

    I think I found a bug. When I use Chrome browser and I zoom in on the page (Ctrl+), scrollbars appear around the vertical text in the element. This only happens in Chrome.

    • Hi Boson,
      Yes, it’s a known bug due to how webkit renders SVG elements…
      Hope to find a solution.
      Bye,
      Matteo

  14. Nikole Zustovic says:

    Hi Matteo,

    I downloaded your flipText file, and for the most part, have had great success with it. Thank you for your development.

    I’ve tested on a number of browsers, and Firefox 5.0 renders the text differently from the others. The row height seems to be fixed at about one character height, so the majority of the text is hidden. Any ideas for how to change or fix the row height in your script?

    Thanks again!

    Nikole

  15. naresh says:

    i want code for imageflip in verically ?how to develop this in jquery? can u send it to my mail “nareshyeddu@gmail.com”

  16. dédé says:

    and if you want “unflip” the text ? Is it possible ?

Trackbacks
Check out what others are saying...
  1. [...] Take a look [...]

  2. [...] This post was mentioned on Twitter by Jeff Schoolcraft and Palle Zingmark, jQueryBuzz. jQueryBuzz said: jquery mb.flipText « Matteo Bicocchi’s Blog http://bit.ly/72fvif [...]

  3. [...] http://pupunzi.open-lab.com/mb-jquery-components/mb-fliptext/ [...]

  4. [...] Oficjalna strona Pluginu (+ dokładna dokumentacja) [...]

  5. [...] Ofic­jalna strona Plug­inu (+ dokładna dokumentacja) [...]



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 140 other followers