SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2005
    Posts
    527
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rtl ltr for wysiwyg editor

    Please see this tutorial
    http://www.devguru.com/features/tuto...g/wysiwyg2.asp

    Now I want add a button for RTL and LTR please help me

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am stabbing in the dark here, but wouldn't you be able to use

    Code:
    iview.document.getElementsByTagName('HTML')[0].setAttribute('DIR','RTL');
    // or
    iview.document.getElementsByTagName('HTML')[0].setAttribute('DIR','LTR');
    or just use setAttribute('DIR','RTL') on the element you want to apply it to.
    Last edited by gRoberts; Sep 20, 2007 at 03:13.


  3. #3
    SitePoint Evangelist
    Join Date
    Dec 2005
    Posts
    527
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is getElementsByTagName('HTML') ?

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol isn't it obvious? maybe not.

    getElementsByTagName will get all instances of the supplied tag, in our case HTML within the containg element, in our case the document wysiwyg.

    Although i've just noticed i made a mistake within my code, which will has been corrected.

    getElementsByTagName returns an array, and I should be selecting the first item within the array.


  5. #5
    SitePoint Evangelist
    Join Date
    Dec 2005
    Posts
    527
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you
    I found better way : .execCommand('dirRTL', false, null);
    .execCommand('dirLTR', false, null);


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •