dcsimg
www.webdeveloper.com
Results 1 to 13 of 13

Thread: text alignment in javascript

  1. #1
    Join Date
    Nov 2017
    Posts
    9

    text alignment in javascript

    i am creating family tree website for this i am using mind fusion org chart API which is opensource i customized i, i removed other extra details from in and kept only single person inside the node. i centered text inside node but text isn't wraped some text are crossed node border i want to make some margin in both side of node and text should be continue from second line when its to large. you can download my customized and mind fusion on code from links bellow:

    mindfusion own code : https://drive.google.com/open?id=1Qw...kcgd5pmtA37T0Z

    my customized code : https://drive.google.com/open?id=1OB...LaBPWGMcIvjcRZ

    any buddy have idea please suggest to me

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,528
    I would say that your alignment would be a CSS problem not a javascript or javascript framework issue.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  3. #3
    Join Date
    Nov 2017
    Posts
    9
    So Waht CSS code should i write for alignment on diagram or diagram link

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,528
    If you head over to the CSS forum, you will see posts where help with positioning of page elements is handled by various instructions, it all depends on what the elements is, where you want it, the size colour and font sizes, etc.

    There are alot of things that used to be done in JavaScript to style a page and CSS came along and took over the biggest part of the fiddly bits.

    If you compared the first JavaScripts to the ones today, the early scripts were monstrous compared to the ones today that are more compact because CSS takes over allot of the styling that JavaScript used to do.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  5. #5
    Join Date
    Nov 2017
    Posts
    9
    i am new to website designing i have some knowladge of software development but no much knowladge of web development i have no idea how to apply css style of javascript element may by by: document.getElementById("p2").style.color = "blue"; but this apply on whole page i want to apply style on only nodes inside page i how can i apply on only some element on on whole page ?

  6. #6
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,528
    Like I said, head over tot the CSS forum and you should find it easy to resolve. Then you can use JavaScript in another way when you want to modify a className of an element, etc.

    All it takes is a little reading so you can pick up whats needed.

    Alternatively, https://www.w3schools.com/css/css_background.asp might help you understand the power of CSS and how it makes your code simpler.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  7. #7
    Join Date
    Nov 2017
    Posts
    9
    thank you for information i want some help i want to add link on some text inside javascript doc here is my code

    Code:
    var samji = new OrgChartNode(diagram, ladha);
        samji.setBounds(new Rect(95, 135, 10, 15));
        samji.setTextPadding(50);
        //samji.setTitle("Media");
        samji.setFullName(";FD\nDFGAF>");
        //samji.setImageLocation("ad.png");
        samji.resize();
        diagram.addItem(samji);
    i want to create link on
    on ";FD\nDFGAF>"
    inside :

    Code:
    samji.setFullName(";FD\nDFGAF>");

  8. #8
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,528
    Ok, thats not JavaScript, it looks like a framework of some sort (aka libraries, widgets, api's and other types of terms)

    If you wish to use a framework rather than JavaScript, please remember to post in the JavaScript Frameworks forum.

    * moved *
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  9. #9
    Join Date
    Nov 2017
    Posts
    9
    this is javascript framework forum when i am typing for this reply there are displaying
    "Qoucik Navigation :Javascript Frameworks(Such as JScript)" in combobox

  10. #10
    Join Date
    Nov 2017
    Posts
    9
    this is also javascript framework forum you may forgot

  11. #11
    Join Date
    Nov 2017
    Posts
    9
    i want some help i want to add link on some text inside javascript doc here is my code

  12. #12
    Join Date
    Dec 2016
    Location
    United Kingdom
    Posts
    12
    If you want to add link then you need to append the elements to the paragraph like this or try this code
    var temp_link = document.createElement("a");
    temp_link.href = "http://test.com";
    temp_link.target = '_blank';
    temp_link.innerHTML = "link";


    var par = document.createElement("p");
    par.innerHTML = "some text: ";
    par.appendChild(temp_link);

    document.getElementById("main_div").appendChild(par);

  13. #13
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,528
    Quote Originally Posted by AkshaySuthar View Post
    this is javascript framework forum when i am typing for this reply there are displaying
    "Qoucik Navigation :Javascript Frameworks(Such as JScript)" in combobox
    Yes, because I moved the post from where you made it to where it is now.

    Anything that uses JavaScript as its own programming language like this tool, JQuery, MooTools, etc. goes in the JavaScript Frameworks forum foun at the top of the JavaScript forum.

    A simple test to see if it is JavaScript or if it is not JavaScript. If you have to include an external library, then it is not JavaScript, even though it may have javascript, that javascript can not be used, accessed or run because it is part of a JQuery or API function that requires said ecternal library file to run the code and javascript then become accessible to those functions.

    JavaScript requires no external support, it is built in and native to the browser and thats the distinct difference and how to tell if something is JQuery (for example) or not.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Posting Permissions

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