Help to align a script box

Discussion in 'HTML & Website Design' started by Cancasa, Feb 20, 2010.

  1. #1
    I'm trying to position the google translate box on a forum theme.
    I inserted the code in the index template file but need it to move to the right a bit more.
    I'm not sure what code I need to make it work. :)
     
    Cancasa, Feb 20, 2010 IP
  2. broxen

    broxen Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    screenshot or link?
    if you're using css to place your script just assign margin-left: 9999px; <<change the value to your need
     
    broxen, Feb 20, 2010 IP
  3. Cancasa

    Cancasa Active Member

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    Thanks Broxen
    It's a php file it is inserted in but not sure how to work it. :confused:
    Sorry,screenshot not uploading.:(
    Not allowed to post link either :mad:

    This is the code below;


    template_menu();

    echo '<div id="google_translate_element"></div><script>'."\n";
    echo 'function googleTranslateElementInit() {'."\n";
    echo 'new google.translate.TranslateElement({'."\n";
    echo 'pageLanguage: \'en\''."\n";
    echo '}, \'google_translate_element\');'."\n";
    echo '}'."\n";
    echo '</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>'."\n";
    echo ''."\n";
     
    Cancasa, Feb 20, 2010 IP
  4. broxen

    broxen Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    poor you :(
    try this code

    template_menu();
    
    echo '<div id="google_translate_element"><script>'."\n";
    echo 'function googleTranslateElementInit() {'."\n";
    echo 'new google.translate.TranslateElement({'."\n";
    echo 'pageLanguage: \'en\''."\n";
    echo '}, \'google_translate_element\');'."\n";
    echo '}'."\n";
    echo '</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script></div>'."\n";
    echo ''."\n";
    PHP:
    on your forum theme's css add this id:
    #google_translate_element {margin-left:50px}
    PHP:
    hope that's help..
     
    broxen, Feb 20, 2010 IP
  5. masud7827

    masud7827 Active Member

    Messages:
    165
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    wow, thanks for those code broxen, works perfect
     
    masud7827, Feb 20, 2010 IP
  6. Cancasa

    Cancasa Active Member

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #6
    Hey Broxen,that worked perfectly,wish I knew stuff like that. :D
     
    Cancasa, Feb 21, 2010 IP
  7. rockjone

    rockjone Peon

    Messages:
    358
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    hay thx Cancasa to ask this quie & Broxen lots of thx to you explain it
     
    rockjone, Feb 21, 2010 IP
  8. broxen

    broxen Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    actually that's simple things. your default code open and close <div> at the same line..
    just move the </div> to the end of script and put a configuration on css file.
    that's will always work :)
     
    broxen, Feb 21, 2010 IP
  9. rlexyd

    rlexyd Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hi,

    I am a newbie and know a little about html.

    I am adding a widget on my HTML website of Twitter and a Facebook Badge..

    I have succefully addedthem and they are working..The only problem is the Twitter widget seems to be a script code and I cannot align it either left or right or have the Facebook badge next to it?

    I have tried to put them next to each other but can't figure it out?
    I can align the facebook badge wherever as it's a normal html code, but I can't figure out the Twitter which is a script!!! How would I align them next to each other!

    Any advice would be greatly appreciated.

    Best Regards,
     
    rlexyd, Jun 10, 2010 IP
  10. it4u

    it4u Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    rlexyd

    Thats the same issue I am having. Have facebook on left but can't get twitter on right as its a script.

    Any help please?

    P.S. Did you manage to solve it?
     
    it4u, Feb 9, 2011 IP